]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed lazy clause construction to go off...you guessed it...the noninherited table !
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Mar 2006 20:15:44 +0000 (20:15 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Mar 2006 20:15:44 +0000 (20:15 +0000)
lib/sqlalchemy/mapping/properties.py

index ff3d1548c1a1ef875f8bbf4193b21825fce84f8c..192ba3fc57b0cc261f1d20afe2d66c47f14cc73f 100644 (file)
@@ -563,7 +563,7 @@ class PropertyLoader(MapperProperty):
 
 class LazyLoader(PropertyLoader):
     def do_init_subclass(self, key, parent):
-        (self.lazywhere, self.lazybinds) = create_lazy_clause(self.parent.table, self.primaryjoin, self.secondaryjoin, self.foreignkey)
+        (self.lazywhere, self.lazybinds) = create_lazy_clause(self.parent.noninherited_table, self.primaryjoin, self.secondaryjoin, self.foreignkey)
         # determine if our "lazywhere" clause is the same as the mapper's
         # get() clause.  then we can just use mapper.get()
         self.use_get = not self.uselist and self.mapper._get_clause.compare(self.lazywhere)
@@ -645,6 +645,7 @@ def create_lazy_clause(table, primaryjoin, secondaryjoin, foreignkey):
     lazywhere = lazywhere.copy_container()
     li = BinaryVisitor(visit_binary)
     lazywhere.accept_visitor(li)
+    print "OK LAZYWHERE, START WITH TAB", table, "PJ", primaryjoin, "SEC", secondaryjoin, "GOT", lazywhere
     return (lazywhere, binds)