if the m2m is implicit, u can use it as plain relation for joins etc; 
except that .has becomes .any and == becomes .contains

see class RelComparator in 
http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/usage/query.py

which i use to make the relation ops look same for m2m and one2m


On Thursday 02 April 2009 19:50:11 Marcin Krol wrote:
> Hello everyone,
>
> For the life of me I can't find it in the docs: what operators are
> available for querying many to many relations?
>
> ORM tutorial shows literally 1 example of 'any' operator
> (BlogPost.keywords.any), which I used successfully, but would like
> to know all the operators I can use for querying many to many rels.
>
>
> dir(BlogPost.keywords) is no good:
>
> (snip internal methods)
> '_yield_per', 'add_column', 'add_entity', 'all', 'autoflush',
> 'correlate', 'count', 'delete', 'distinct', 'enable_eagerloads',
> 'except_', 'except_all', 'filter', 'filter_by', 'first',
> 'from_self', 'from_statement', 'get', 'group_by', 'having',
> 'instances', 'intersect', 'intersect_all', 'iterate_instances',
> 'join', 'limit', 'logger', 'offset', 'one', 'options', 'order_by',
> 'outerjoin', 'params', 'populate_existing', 'query_from_parent',
> 'reset_joinpoint', 'scalar', 'select_from', 'session', 'slice',
> 'statement', 'subquery', 'union', 'union_all', 'update', 'value',
> 'values', 'whereclause', 'with_labels', 'with_lockmode',
> 'with_parent', 'with_polymorphic', 'yield_per']
>
>
> Regards,
> mk
>
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to