fixed lodgeit.database to work with sa 0.6, fixed cleanup_callbacks

This commit is contained in:
Christopher Grebs 2010-05-15 12:28:19 +02:00
parent 24f20d553c
commit 7708412f68
2 changed files with 6 additions and 7 deletions

View File

@ -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

View File

@ -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):