Turn all Session() into SmartSession().
This session allows the internal scope to pick up an external session and use it and leave it open, or start an internal session that closes when done.
It also allows passing False to make a "no op" session that never touches the database.
This can also be set globally using src.database.NO_DB_SESSION=True.
The regular Session() can still be called, but it would need an explicit session.begin() to be called.
Turn all Session() into SmartSession(). This session allows the internal scope to pick up an external session and use it and leave it open, or start an internal session that closes when done.
It also allows passing
False
to make a "no op" session that never touches the database. This can also be set globally usingsrc.database.NO_DB_SESSION=True
.The regular
Session()
can still be called, but it would need an explicitsession.begin()
to be called.