From: Chris Mcdonough Date: Wed, 12 Dec 2007 20:20:03 +0000 (+0000) Subject: bug fixes X-Git-Tag: rel_0_4_2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f6a0981351697192651ef7437fdc451c1ad71ab;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git bug fixes - 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 --- diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index bc9da18ba0..a8699f832a 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -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 diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py index af1be28bc6..63bdaea40a 100644 --- a/lib/sqlalchemy/orm/dynamic.py +++ b/lib/sqlalchemy/orm/dynamic.py @@ -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()