From: Mike Bayer Date: Sat, 19 May 2012 23:40:13 +0000 (-0400) Subject: fix logic here broken by the change for enable_relationship_loading X-Git-Tag: rel_0_8_0b1~415 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e1904f8680937e42497995bab42d39a4045148f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix logic here broken by the change for enable_relationship_loading --- diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index e1f8387939..70e06723ac 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -448,10 +448,14 @@ class LazyLoader(AbstractRelationshipLoader): return criterion def _load_for_state(self, state, passive): - if not state.session_id or \ - not state.key and \ - not self.parent_property.load_on_pending and \ - not state._load_pending: + if not state.key and \ + ( + ( + not self.parent_property.load_on_pending + and not state._load_pending + ) + or not state.session_id + ): return attributes.ATTR_EMPTY pending = not state.key