[sqlalchemy] Re: in_ operator as kwarg to filter_by

2007-06-20 Thread David S.
snip But now a user of the query needs to know about the underlying selectable itself In case anyone reads this for info, that last statement is not true because you can access the columns from the mapped class. See

[sqlalchemy] Re: in_ operator as kwarg to filter_by

2007-06-18 Thread Michael Bayer
On Jun 18, 2007, at 11:47 AM, David S. wrote: I know that you can: my_query.select_by(my_source.c.code.in_('1', '2')) Is there a way to use kwargs with in_ as you can with equality settings, as in: my_query.select_by(code='1') Since SA is NOT a framework, I imagine I could wrap the

[sqlalchemy] Re: in_ operator as kwarg to filter_by

2007-06-18 Thread David S.
django's method of shoving SQL operators into the names of keyword arguments seems horribly ugly to me. SQLAlchemy's approach is to use query.filter(sometable.c.col.in_(x, y)). it uses the same operators as everything else without the need to memorize magic codes to embed in keyword