def ngw_txn(ngw_env): with manager as t: yield t try: DBSession.flush() t.abort() finally: DBSession.expunge_all() DBSession.expire_all()
def txn(): from nextgisweb.models import DBSession from transaction import manager _env_initialize() with manager as t: yield t try: DBSession.flush() t.abort() finally: DBSession.expunge_all() DBSession.expire_all()