[sqlalchemy] Re: query.instances and select statement

2007-05-30 Thread Eric Ongerth
So far I've been having a great time with generative query-building methods... build a query, filter it, order it, etc... Is there a way to, uh, de-generate a query? E.g., q0 = session.query(someclass) q1 = q.filter(col == value) q2 = q.filter(othercol == othervalue) # all of the above works

[sqlalchemy] Re: query.instances and select statement

2007-05-30 Thread Michael Bayer
On May 30, 2007, at 4:50 PM, Eric Ongerth wrote: So far I've been having a great time with generative query-building methods... build a query, filter it, order it, etc... Is there a way to, uh, de-generate a query? E.g., q0 = session.query(someclass) q1 = q.filter(col == value) q2 =

[sqlalchemy] Re: query.instances and select statement

2007-05-30 Thread Eric Ongerth
On May 30, 2:06 pm, Michael Bayer [EMAIL PROTECTED] wrote: On May 30, 2007, at 4:50 PM, Eric Ongerth wrote: Is there a way to, uh, de-generate a query? E.g., ... As it stands now, this is not actually difficult to do: I just store a set of filters that have been added so far, and when

[sqlalchemy] Re: query.instances and select statement

2007-05-30 Thread Huy Do
Michael Bayer wrote: On May 29, 2007, at 10:28 PM, Huy Do wrote: s = select() query = db.query(model.Invoice).options(contains_eager('client')) query = query.from_select(s) # query = query.limit(10).offset(10) rs = query.list() What I'm doing, is pretty much setting up a query in

[sqlalchemy] Re: query.instances and select statement

2007-05-29 Thread Michael Bayer
On May 29, 2007, at 10:28 PM, Huy Do wrote: s = select() query = db.query(model.Invoice).options(contains_eager('client')) query = query.from_select(s) # query = query.limit(10).offset(10) rs = query.list() What I'm doing, is pretty much setting up a query in one place of my program,