Re: [sqlalchemy] Trying to apply result of raw sql to an 'in_' clause of mapped table

2012-11-21 Thread Audrius Kažukauskas
On Wed, 2012-11-21 at 13:05:22 +0100, Ralph Heinkel wrote: The latter was my favorite, but this seems to fail with [...] File /usr/local/lib/python2.7/site-packages/SQLAlchemy-0.5.8-py2.7.egg/sqlalchemy/sql/expression.py, line 1390, in in_ return self._in_impl(operators.in_op,

Re: [sqlalchemy] Trying to apply result of raw sql to an 'in_' clause of mapped table

2012-11-21 Thread Michael Bayer
On Nov 21, 2012, at 7:05 AM, Ralph Heinkel wrote: Hi Michael, thanks for your reply. but with that aside, you can use text(): from sqlalchemy import text, bindparam Person.status_id.in_(text(select status_id ..., bindparams=[bindparam('n1', 'hired')])) and the bind values you can

Re: [sqlalchemy] Trying to apply result of raw sql to an 'in_' clause of mapped table

2012-11-21 Thread Ralph Heinkel
The latter was my favorite, but this seems to fail with [...] File /usr/local/lib/python2.7/site-packages/SQLAlchemy-0.5.8-py2.7.egg/sqlalchemy/sql/expression.py, line 1390, in in_ return self._in_impl(operators.in_op, operators.notin_op, other) File

Re: [sqlalchemy] Trying to apply result of raw sql to an 'in_' clause of mapped table

2012-11-19 Thread Michael Bayer
On Nov 19, 2012, at 2:44 PM, Ralph Heinkel wrote: Hi everybody, I've banging my head against this for hours ... maybe someone can help? For a mapped class called 'Person' I'm trying to do something like: query(Person).filter(Person.status_id.in_('select status_id from