--- a/iro/model/utils.py Sat Jan 28 12:24:40 2012 +0100
+++ b/iro/model/utils.py Sat Jan 28 13:02:07 2012 +0100
@@ -1,5 +1,7 @@
from sqlalchemy.orm import sessionmaker
+from .session import IroSession
+
class WithSession(object):
'''a with statement for a database session connection'''
def __init__(self, engine, autocommit=False):
@@ -7,7 +9,7 @@
self.autocommit=autocommit
def __enter__(self):
- self.session = sessionmaker(bind=self.engine)()
+ self.session = sessionmaker(bind=self.engine, class_ = IroSession)()
return self.session
def __exit__(self,exc_type, exc_value, traceback):