Re: [sqlalchemy] Best usage while using session

2010-11-01 Thread Michael Bayer
you'd want to put a unique constraint on your username column, then let the transaction fail, do a rollback(), report the username isn't available. If you'd like to do the rollback and then continue without losing other pending changes, you'd use begin_nested(). On Oct 31, 2010, at 3:35 PM,

Re: [sqlalchemy] Best usage while using session

2010-11-01 Thread Guguscat
Thank you for this precision. Now comes an other problem (I think) : In fact I might have multiple columns with unique constraints or whatever constraints. Then I take a look at SQLAlchemy Exceptions, and I found that Note that there is no guarantee that different DB-API implementations will

[sqlalchemy] Best usage while using session

2010-10-31 Thread Guguscat
Hello, I am using SQLAlchemy in a Pylons project and I like it. However I am questioning about the best way to insert data into a database. I have a User class mapping my user table which has a Column 'username' which has a unique constraint. So I have a form to add a new user when I submit