I\'m a beginner in SQLAlchemy and found query can be done in 2 method:
Approach 1:
DBSession = scoped_session(sessionmaker())
class _Base(object):
An answer (here) to a different SQLAlchemy question might help. That answer starts with:
You can use
Model.query
, because theModel
(or usually its base class, especially in cases where declarative extension is used) is assignedSesssion.query_property
. In this case theModel.query
is equivalent toSession.query(Model)
.