Table A has two columns: ID and name
I want to input 3 ID and get 3 name, my way looks like
ID_list = [1,3,4]
DBSession.query(TableA).filter(or_(TableA.id == input_ID_list[0], TableA.id == input_ID_list[1], TableA.id == input_ID_list[2])
which looks quite foolish.
Is there a cleaner way to finish this job in SQLAlchemy, such as this:
DBSession.query(TableA).filter(TableA.id.in_(input_ID_list))
Already know the answer, there is a
in_function