Samrat Man Singh Samrat Man Singh - 8 months ago 15
SQL Question

How to query database by id using SqlAlchemy?

I need to query a SQLAlchemy database by its

something similar to


but for id. How do I do this? [Searching over Google and SO didn't help]


Query has a get function that supports querying by ID.

For example, to query for an object with ID of 23: User.query.get(23)