I want a query with multiple value like where id in (3,4,5)
Then I have a my_list = [3,4,5]
so how can I pass that list as an argument to filter in sqlalchemy?
query = Notification.query.filter_by(id=my_list).all()
I want a query with multiple value like where id in (3,4,5)
Then I have a my_list = [3,4,5]
so how can I pass that list as an argument to filter in sqlalchemy?
query = Notification.query.filter_by(id=my_list).all()
Use in_ with filter:
query = Notification.query.filter(Notification.id.in_(my_list)).all()
Here's the relevant SO Q&A, and Read the Doc from sqlalchemy