fixed lodgeit.database to work with sa 0.6, fixed cleanup_callbacks
This commit is contained in:
parent
24f20d553c
commit
7708412f68
@ -45,7 +45,7 @@ class LodgeIt(object):
|
||||
self.bind_to_context()
|
||||
|
||||
self.cleanup_callbacks = (db.session.close, _local_manager.cleanup,
|
||||
self.bind_to_context())
|
||||
self.bind_to_context)
|
||||
|
||||
def bind_to_context(self):
|
||||
ctx.application = application = self
|
||||
|
@ -22,12 +22,11 @@ metadata = MetaData()
|
||||
|
||||
|
||||
def session_factory():
|
||||
opts = {
|
||||
'autoflush': True,
|
||||
'transactional': True}
|
||||
return orm.create_session(application.engine, **opts)
|
||||
session = orm.scoped_session(
|
||||
session_factory, scopefunc=_local_manager.get_ident)
|
||||
options = {'autoflush': True, 'autocommit': False}
|
||||
return orm.create_session(application.engine, **options)
|
||||
|
||||
session = orm.scoped_session(session_factory,
|
||||
scopefunc=_local_manager.get_ident)
|
||||
|
||||
|
||||
class ModelBase(object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user