Michael Bayer wrote: > the error is because of the allow_column_override, combined with the > fact that you haven't reassigned the column attributes for "left" and > "right". the "left" and "right" columns on table2 need to be > available as scalar attributes on your Table2 class since thats how > foreign key attributes are tracked. > > so get rid of the "allow_column_override" (any error message that says > "specify X to ignore this condition" is pretty much a red flag) and > set up the foreign key columns as something: > > mapper(Table2, table2, properties={ > '_left':table2.c.left, > '_right':table2.c.right, > 'left':relation(Table1, > primaryjoin=table1.c.id==table2.c.left), > 'right':relation(Table1, > primaryjoin=table1.c.id==table2.c.right), > > }) >
Thanks! This works as well and is much more elegant. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---