[sqlalchemy] Re: Comparing tuples

2008-09-04 Thread Christoph Zwerschke
Michael Bayer schrieb: > just use the plain string and not text(), and use :paramname as the > bind param format. example is here: > http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_querying_using Excellent, that works: print session.query(User).filter( "(last_name, first_n

[sqlalchemy] Re: Comparing tuples

2008-09-04 Thread Michael Bayer
just use the plain string and not text(), and use :paramname as the bind param format. example is here: http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_querying_using On Sep 4, 2008, at 9:25 AM, Christoph Zwerschke wrote: > > This does not work either: > > print session.que

[sqlalchemy] Re: Comparing tuples

2008-09-04 Thread Christoph Zwerschke
This does not work either: print session.query(User).filter( text("(last_name, first_name) < (%(last_name)s, %(first_name)s)", )).params(first_name='Joe', last_name='Doe').all() Running out of ideas... -- Christoph --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: Comparing tuples

2008-09-04 Thread Christoph Zwerschke
> Is there a simple way of comparing tuples in the SQLAlchemy query > language, like (User.last_name, User.first_name) < ('Joe', 'Doe')? > SQL-wise it is possible (at least with PostgreSQL), but you cannot write > this as a filter expression. Tried the following, but it does not work: print sess