On Oct 17, 1:36 am, Michael Bayer <mike...@zzzcomputing.com> 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 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_().
users = relation('cp_users', primaryjoin=and_
(device_id==cp_users.device_id,client_id==cp_users.client_id),foreign_keys=
[cp_users.device_id,cp_users.client_id])
works. I made the assumption since my class was defined below that I
needed the quotes as I do in some of the relations.
Thanks for the quick response.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---