> > hi
> > say i have Person, Address, Street:
> > person has (many) addresess, address has (many) streets,
> > ... could be more levels down; and the relations are m2m for
> > better taste (:
> > how should the query 'who lives at street X', or
> > "who lives at street with .name.startswith('A')" look like?
> > is it expressable in relational operators or it has to be sqlized
> > via joins etc?
>
> I'd probably just use joins for this.  If by "relational" operators
> you're referring to any(), you can make an any() that goes across
> more tables by sticking join crtierion inside the any() along with
> the criterion, though that would be fairly cumbersome here since
> they are m2m.

hmm. the joins are ... hard to generate, especialy in proper/sensible 
combinations. (i've nearly given up on pushing further my 
python-expression-to-sa converter, the logic fails on 1/3 of the 
a.b.c join-cases.) 
And especialy if there is OR involved... (these damned ORs -:)
As there's no filter_or(), i was thinking i'll be able to do 
generatively 
myfilter = some.thing.has(this) | some.otherthing.any(that) & .. 
then query.filter( myfilter)
but seems that's still in unforeseeable __future__
if the any/has/... can nest subselects, cant that be made somehow more 
levels? sa sure knows all that is needed to make that.. 

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