On Friday 21 November 2008 12:42:31 SinJax wrote:
and another way:
allAnn = Annotation.query(
).join( 'user').filter_by( py_user = "msn"
).reset_joinpoint().filter( Annotation.subject == somesubject )
and
allAnn = Annotation.query(
).filter_by( subject = somesubject
).join( 'user').filter_by( py_user = "msn")
the last may or may not work depending on which SAversion you are.
see the order of filters above, u may have to tweak yours or use
reset_joinpoint()
btw i have an enhanced version of .filter_by that takes 'a.b.c.d' as
keys and does the joins internaly, i.e.
A.query().filter_by( somex=5, **{'some.many.level.relation': 22})
does same as
A.query().filter_by( somex=5
).join( 'some.many.level'
).filter_by(relation= 22)
might seem ugly but is actualy quite short and nice to read, avoiding
implementation details (joins in the case)
ciao
svil
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---