[sqlalchemy] Re: Do the columns in 'foreign_keys' represent only the 'foreign' columns in this join condition ?

2009-10-16 Thread cd34
On Oct 17, 1:36 am, Michael Bayer wrote: > At the moment you have an and_() of two string expressions, which   > SQLalchemy knows nothing about and therefore cannot apply mapping   > logic to it.   When using declarative, you do have the option to quote   > the expression in the case that you'd

[sqlalchemy] Re: Do the columns in 'foreign_keys' represent only the 'foreign' columns in this join condition ?

2009-10-16 Thread Michael Bayer
On Oct 17, 2009, at 1:07 AM, cd34 wrote: > > When I add the second condition in the primaryjoin as: > >users = relation('cp_users', primaryjoin=and_ > ('cp_package_device.device_id > = > = > cp_users.device_id > ','cp_package_device.client_id==cp_users.client_id'),foreign_keys= > ['cp_users.