On Jul 22, 2011, at 9:22 AM, Oliver Christen wrote:

> okay, I succeded to get the property I want:
> 
> from sqlalchemy import UniqueConstraint
> from myproject import model
> 
> for constraint in model.User.__table__.constraints:
>    if isinstance(constraint, UniqueConstraint):
>        for columns in constraint.columns:
>            print 'column ' + columns.name + ' has unique contraint'
> 
> is there a better way to do that ?

I think that's it for now there's no convenience accessor for that.

Depending on what you're trying to do, you might want to consider the usage of 
application conventions, placing memoizations related to your application in 
the .info dictionary of the Column.  It's accepted by the constructor.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to