python - filter with more than one value on flask-sqlalchemy -
i want query multiple value where id in (3,4,5)
then have my_list = [3,4,5] how can pass list argument filter in sqlalchemy?
query = notification.query.filter_by(id=my_list).all()
use in_ filter:
query = notification.query.filter(notification.id.in_(my_list)).all() here's relevant so q&a, , read doc sqlalchemy
Comments
Post a Comment