SQLAlchemy SessionTransaction has query attribute?

Viewed 1090

I'm pretty new in Python and SQLAlchemy, so basically I changed from:

session = Session()
session.query(SOMETHING_HERE).filter()

to

session = Session()
nested_session = session.begin_nested()
nested_session.query(SOMETHING_HERE).filter()

in order to use SAVEPOINTS. But I'm getting the error:

AttributeError: 'SessionTransaction' object has no attribute 'query'

I did a deep dive in the documentation, like these:

But it did not help me.

Questions: Am I able to use begin_nested to run query with filter like that or I need to change the approach? Is this a version issue (sql alchemy for example)?

1 Answers
Related