Rework versioning support to allow it to be one or off.
Turns out versioning isn't quite ready for prime time, so let's have a fallback plan shall we?
This commit is contained in:
parent
bd44d886c4
commit
aa70ffc9f0
9 changed files with 12 additions and 12 deletions
|
@ -32,7 +32,7 @@ import sqlalchemy_continuum as continuum
|
|||
from sqlalchemy.orm import sessionmaker, scoped_session
|
||||
|
||||
from rattail.db import SessionBase
|
||||
from rattail.db import model
|
||||
from rattail.db.continuum import versioning_manager
|
||||
|
||||
|
||||
Session = scoped_session(sessionmaker(class_=SessionBase))
|
||||
|
@ -53,8 +53,7 @@ class TailboneSessionDataManager(datamanager.SessionDataManager):
|
|||
if self.tx is not None: # there may have been no work to do
|
||||
|
||||
# Force creation of Continuum versions for current session.
|
||||
mgr = continuum.get_versioning_manager(model.Product) # any ol' model will do
|
||||
uow = mgr.unit_of_work(self.session)
|
||||
uow = versioning_manager.unit_of_work(self.session)
|
||||
uow.make_versions(self.session)
|
||||
|
||||
self.tx.commit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue