python flask sqlalchemy extract ids from table as a list code example Example: sqlalchemy get ids session.query(Thing.id).all()