Refactor tempmon views to leverage rattail-tempmon database
This commit is contained in:
parent
083f8ecde0
commit
8674cf1650
7 changed files with 80 additions and 42 deletions
|
@ -37,6 +37,9 @@ from rattail.db.continuum import versioning_manager
|
|||
|
||||
Session = scoped_session(sessionmaker(class_=SessionBase, rattail_config=None, rattail_record_changes=False))
|
||||
|
||||
# not necessarily used, but here if you need it
|
||||
TempmonSession = scoped_session(sessionmaker())
|
||||
|
||||
|
||||
class TailboneSessionDataManager(datamanager.SessionDataManager):
|
||||
"""Integrate a top level sqlalchemy session transaction into a zope transaction
|
||||
|
@ -144,5 +147,7 @@ def register(session, initial_state=datamanager.STATUS_ACTIVE,
|
|||
# TODO: We can probably assume a new SA version since we use Continuum now.
|
||||
if tuple(int(x) for x in sa.__version__.split('.')) >= (0, 7):
|
||||
register(Session)
|
||||
register(TempmonSession)
|
||||
else:
|
||||
Session.configure(extension=ZopeTransactionExtension())
|
||||
TempmonSession.configure(extension=ZopeTransactionExtension())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue