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.device_id','cp_users.client_id']) 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 like to generate it before dependent classes are constructed, but this means you are quoting the entire expression sent to "primaryjoin" - this means "and_ (foo.col==bar.col)". Or in this case if all of those column objects are available, you can lose the quotes inside of the and_(). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---