Cool.  I wasn't sure if it was ready for filter(A.bs == list_of_bs).
When I tried to do that before, I must have let some silly syntax
error keep me from realizing that it was a workable construction.

Thanks!

On Mar 5, 8:20 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Mar 5, 2008, at 10:50 AM, Eric Ongerth wrote:
>
> > Anyway -- so what would really clean it all up would be:
>
> > session.query(A).filter(A.bs.contains(list_of_bs_being_sought)).all().
>
> > THAT would do exactly what I'm trying to accomplish.  But it would
> > require contains() to accept a list and know what to do with it.  My
> > proposal would be that the expected behavior is for contains() to
> > construct an intersect of selects where each select is like the one it
> > creates in its simpler case where the argument to contains() is a
> > scalar instead of a list.  Does that make sense?
>
> Well i think we'd call the operator intersect().  However I think this
> will do what you want right now if you were to say:
>
>         session.query(A).filter(A.bs == list_of_bs).all()
>
> since it will generate individual EXISTS predicates for each element
> in the list.
--~--~---------~--~----~------------~-------~--~----~
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