How do I get a list of ids instead of a list of SQLAlchemy objects? Currently I'm doing this: [x.id for x in random_query.all()] Is there a better way of doing this, preferably by only using SQLAlchemy statements. Continue reading...