]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
bug fixes
authorChris Mcdonough <chrism@plope.com>
Wed, 12 Dec 2007 20:20:03 +0000 (20:20 +0000)
committerChris Mcdonough <chrism@plope.com>
Wed, 12 Dec 2007 20:20:03 +0000 (20:20 +0000)
- the call to self.get() in get_committed_state was missing a required parameter, rendered sqlalchemy unusable in certain situations

- fixed a large bug in dynamic_loader() where the query criterion wasn't generated correctly if other relations existed to dynamic_loader's argument

lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/dynamic.py

index bc9da18ba0bc1c3383ab84ff0f048e3234bfc4a8..a8699f832a4bebf64280159cdb808138318cc7fd 100644 (file)
@@ -263,7 +263,7 @@ class AttributeImpl(object):
     def get_committed_value(self, state):
         if state.committed_state is not None:
             if self.key not in state.committed_state:
-                self.get()
+                self.get(state)
             return state.committed_state.get(self.key)
         else:
             return None
index af1be28bc6bfe5243ed2d83b6ef1564cf1edde3c..63bdaea40ac7d80f0a12efe91ee6a49616933b25 100644 (file)
@@ -117,7 +117,7 @@ class AppenderQuery(Query):
                 except exceptions.InvalidRequestError:
                     raise exceptions.InvalidRequestError("Parent instance %s is not bound to a Session, and no contextual session is established; lazy load operation of attribute '%s' cannot proceed" % (mapperutil.instance_str(instance), self.attr.key))
 
-        return sess.query(self.attr.target_mapper).with_parent(instance)
+        return sess.query(self.attr.target_mapper).with_parent(instance, self.attr.key)
 
     def assign(self, collection):
         instance = self.state.obj()