Re: [Sqlalchemy-users] ORM query using order_by, limit, offset

2006-07-21 Thread Michael Bayer
two general strategies are to use the SelectResults plugin: from sqlalchemy.ext.selectresults import SelectResultsExt mapper(Class, table, extension=SelectResultsExt()) result = query.select_by(name='john').order_by(table.c.foo).limit(10) or play with the join_by() functi

[Sqlalchemy-users] ORM query using order_by, limit, offset

2006-07-20 Thread Martin Stein
Hi everybody, I was wondering if it's possible to do a mapper query like this: result = query.select_by(name='john') including order_by, limit, or offset specifications? So far, I have only been able to do this with: result = query.select(users_table.c.user_name=='john', limit=10) for example