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

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -