iro/model/utils.py
branchdevel
changeset 122 b55754aa4f96
parent 117 351a02310dd8
child 259 5d9c24c2cb8d
child 260 4a03119a98c1
--- 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):