I haven't seen how to do this using the relation directly. I do:

session.query(Someclass).join(OtherClass).filter_by(OtherClass.field==somevalue)



I did do some experimenting with a more abstract approach, but did not find
any need in my application. The only advantage is that it takes away the
need to know up front what is the name of the other class. That might be
useful if you are building a framework based on SA, but not in most
applications.

otherclas = SomeClass.relname.property.mapper
session.query(Someclass).join(otherclas).filter_by(otherclas.c.field==somevalue)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to