]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix logic here broken by the change for enable_relationship_loading
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 19 May 2012 23:40:13 +0000 (19:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 19 May 2012 23:40:13 +0000 (19:40 -0400)
lib/sqlalchemy/orm/strategies.py

index e1f83879393504f125b111240eba7d3bacf69c45..70e06723ac7fea39eb6134113ac6922464e54fa2 100644 (file)
@@ -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