you could use the in_ for this without looping over the list
eg:-

or_(users.c.status_id.in_(status))

On Tue, May 27, 2008 at 4:30 PM, <[EMAIL PROTECTED]> wrote:

>
> On Tuesday 27 May 2008 23:37:20 mg wrote:
> > i am trying to generate an or_ clauselist and was wondering if i
> > could do so with a list comprehension, below is a small example of
> > what i first tried:
> > status = [1,2,3]
> > or_([users.c.status_id == item for item in status])
> >
> > any ideas or tips would be great.
> how about
>  or_(*[users.c.status_id == item for item in status])
> ?
> note the * for *args
>
> >
>


-- 
Shreya

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