Wednesday, August 22, 2012

SQLAlchemy: where in list filter clause

use in_ method:

query.filter(User.name.in_(['ed', 'wendy', 'jack']))

Resource:
http://docs.sqlalchemy.org/en/rel_0_5/ormtutorial.html#querying

No comments: