It sounds like you want to parse IntegrityError to provide nice error messages and handle the race condition between the user pressing the 'is this username still available?' button you should have on your form, and submitting the form, and that you would rather have a rollback than an extra query or two.
I don't think you will have a very nice time parsing IntegrityError. IIRC In SQLAlchemy you can just .add() and .flush() to get the potential IntegrityError right away, and then re-validate all the unique fields on your form (probably 1) for the user's edification. It's also quite possible, even likely, that a rollback may be more expensive than the extra 'try not to screw it up' queries. Don't lose any sleep over the username-taken-while-form-being-filled-out race condition. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
