Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Michael Bayer
you need to name the "secondary" table as it's name in the MetaData collection, not the variable name you've assigned it to, when configuring with string arguments. On Mar 11, 2014, at 6:50 PM, Bala wrote: > Hi Michael, thanks for the prompt reply. > > However, When I tried according to the

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala Ramakrishnan
It works now after I changed the association from groups_and_groups_assoc_table to groups_and_groups: 45class Groups(ModelBase, VersionColumnMixin): 46domain_id = sa.Column(sa.String(36), DefaultClause('default'), nullable=False) 47description = sa.Column(sa.Text)

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala Ramakrishnan
On Tuesday, March 11, 2014 4:39:54 PM UTC-7, Michael Bayer wrote: > > you need to name the “secondary” table as it’s name in the MetaData > collection, not the variable name you’ve assigned it to, when configuring > with string arguments. > > > On Mar 11, 2014, at 6:50 PM, Bala > wrote: > > Hi

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala
Hi Michael, thanks for the prompt reply. However, When I tried according to the suggestion, I get this error: 45class Groups(ModelBase, VersionColumnMixin): 46domain_id = sa.Column(sa.String(36), DefaultClause('default'), nullable=False) 47description = sa.Column(

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Michael Bayer
On Mar 11, 2014, at 3:50 PM, Bala wrote: > 45class Groups(ModelBase, VersionColumnMixin): > 46id = sa.Column('id', sa.Integer, Sequence('id_seq'), > primary_key=True) > 47domain_id = sa.Column(sa.String(36), DefaultClause('default'), > nullable=False) > 48

[sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala
I am using version 0.9.3. When defining a many-to-many self-referential relationship, I found that the primary key column has to be defined in the table itself. It cannot be defined in the model base or a mixin class from which this entity is derived. For example: Given these definitions: