Now what about the fact that ([1,2,3] == [2,3,1])  is False in Python?
Is it the same for the == in the filter() shown above?  I want this
query to succeed regardless of order.  Do I have to keep my list_of_bs
in a known order, both in the collection and in my filter list, for it
to work?  It just so happens that I do have a criterion by which I
*could* order them consistently, but I wasn't planning to have to do
that unless necessary.


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