the query.select() method takes the "WHERE" clause as an argument (and can also take an ORDER_BY), so the technique shown in the doc should be transferrable to the query() object pretty directly.
On Jun 14, 2006, at 9:13 AM, Keith Edmunds wrote: > I would like to build up a query in a way similar to that shown in the > documentation at > http://www.sqlalchemy.org/docs/sqlconstruction.myt#sql_building > > However, rather than working with a single table, I am using two > tables, > one of which is a simple lookup table (id-to-text) for one of the > fields > in the main table, and so I have code: > > # Map objects to database > mapper(Category, categories) > mapper(Todo, todos, properties = dict( > category = relation(Category))) > > I have been working, until now, with a query object: > > q = session.query(Todo) > > Is there a way of incrementally building the select criteria as in the > documentation referred to above, but using a query object? Or am I > approaching this entirely the wrong way? > > Thanks > > > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users