]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Changed mapper.get_session to compile mapper and thereby create the
authorsean <none@none>
Wed, 21 Jun 2006 16:24:05 +0000 (16:24 +0000)
committersean <none@none>
Wed, 21 Jun 2006 16:24:05 +0000 (16:24 +0000)
extension chain needed to lookup the current session.

lib/sqlalchemy/orm/mapper.py

index 397ae3a975d95c9b41e910410a9c868018fe30ad..101f46580bf7a8d9758a81d9bfb644c00f9ba1b8 100644 (file)
@@ -630,6 +630,7 @@ class Mapper(object):
         raises InvalidRequestError if a session cannot be retrieved from the
         extension chain
         """
+        self.compile()
         s = self.extension.get_session()
         if s is EXT_PASS:
             raise exceptions.InvalidRequestError("No contextual Session is established.  Use a MapperExtension that implements get_session or use 'import sqlalchemy.mods.threadlocal' to establish a default thread-local contextual session.")
@@ -1398,4 +1399,4 @@ def class_mapper(class_, entity_name=None, compile=True):
     else:
         return mapper
     
-    
\ No newline at end of file
+