On May 27, 2008, at 3:11 PM, Martin Pengelly-Phillips wrote:

>
>
> Hi Michael,
>
> Thank you for the quick response. I had thought about using a
> straightforward OR statement - are you suggesting that this would form
> the body of the in_() method on the Comparator or were you referring
> more to just compiling the OR statements in the base query?

i was saying the result of in_() would be a construct like:

or_(*[col1.in_([x,y,z]), col2.in_([d, e, f]), ...])

> Also, what is the correct expression for defining a subquery with the
> ORM interface (I gather my embedded session.query statement currently
> evaluates as a separate statement to return the list of candidates).

any select() constituites a subquery when placed wihtin an enclosing  
select().   Often its a good idea to further enclose it in an Alias  
construct by saying select().alias().  Read through the SQL expression  
tutorial for examples.

the subquery() method on Query wouldn't be used inside of a Comparator  
since theres no Query object available in those methods and its an  
overly heavy-handed approach at that level.



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