From: sean Date: Wed, 21 Jun 2006 16:24:05 +0000 (+0000) Subject: Changed mapper.get_session to compile mapper and thereby create the X-Git-Tag: rel_0_2_4~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6668720a5a932a706434f50b216d80a194b21b8b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Changed mapper.get_session to compile mapper and thereby create the extension chain needed to lookup the current session. --- diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 397ae3a975..101f46580b 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -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 +