> >> cls.query.left_bracket().filter_or(cls.y ==
> >> 17).filter_or(cls.x==27).right_bracket()
> >> is clearer than this:
> >> cls.query.filter(or_(cls.y == 17, cls.x==27))
> >
> > it's not. it's not about replacing the or_. noone should use it
> > that way...
> >
> > u have horses and owners with houses and hats.
> > give me horses (whose owners have a hat of size 10 and color
> > green) or (whose owners have a house of color red) or (have no
> > tail)
>
> filter(or_(
>       horses.owners.any(hatsize=10, color='green'),
>       horses.owners.any(and_(owners.house_id==houses.house_id,
> houses.color=='red')),
>          horses.tail == None
> ))

ahha, so thats how joins can go inside or_(). 
isn't this (i guess it has subselects) more expensive than a single 
plain or/and clause?


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to