On Feb 17, 2012, at 6:34 AM, Alejandro Mery wrote:

> Hi Michael,
> 
> On Feb 17, 1:02 am, Michael Bayer <[email protected]> wrote:
>> you'd want to stick that FKconstraint in __table_args__:
>> 
>> class C(Base):
>>     # ...
>> 
>>     __table_args__ = (ForeignKeyConstraint(...), )
>> 
>> that way it gets appended to the Table object's list of constraints.
> 
> no problem with that, but I still wonder why UniqueConstraint(B.foo,
> B.bar) is able to modify the table's list of constraints without using
> __table_args__ and ForeignKeyConstraint can't.

that is a little strange, and would appear to be that UniqueConstraint is 
sharing functionality with Index which does do this (in DDL , CREATE INDEX is 
separate which is the driving factor here).     It's not intended to be like 
that and http://www.sqlalchemy.org/trac/ticket/2410 is added.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to