Re: [Sqlalchemy-users] Using before_insert to implement a special unique constraint

2006-09-26 Thread Kai
On Mon, Sep 25, 2006 at 10:43:48PM -0500, Jeremy Lowery wrote: > I am attempting to create a special kind of unique constraint on a > table. The database models users, groups and realms. I am attempting to > force usernames to be unique inside of a single realm. If your table looks like create

[Sqlalchemy-users] Using before_insert to implement a special unique constraint

2006-09-25 Thread Jeremy Lowery
I am attempting to create a special kind of unique constraint on a table. The database models users, groups and realms. I am attempting to force usernames to be unique inside of a single realm. I surmised that the check for this should go inside of a mapper extension on before_insert: class