]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
(no commit message)
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Oct 2005 02:50:52 +0000 (02:50 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Oct 2005 02:50:52 +0000 (02:50 +0000)
lib/sqlalchemy/sql.py
lib/sqlalchemy/util.py

index c3071e0b0ce70cf467c7b3123f93f767bcd424aa..6262cc3ad5e13c32f0eaa2b6efa6480603b5cf10 100644 (file)
@@ -556,14 +556,17 @@ class Join(Selectable):
 
     engine = property(lambda s:s.left.engine or s.right.engine)
 
+    class JoinMarker(FromClause):
+        def __init__(self, id, join):
+            FromClause.__init__(self, from_key=id)
+            self.join = join
+            
     def _process_from_dict(self, data, asfrom):
         for f in self.onclause._get_from_objects():
             data[f.id] = f
         for f in self.left._get_from_objects() + self.right._get_from_objects():
-            # mark the object as a "blank" from that wont be printed
-            # TODO: now, when one of the existing froms is also a join that should be
-            # joined to us, join up to it.
-            data[f.id] = FromClause(from_key=f.id)
+            # mark the object as a "blank" "from" that wont be printed
+            data[f.id] = Join.JoinMarker(f.id, self)
         # a JOIN always impacts the final FROM list of a select statement
         data[self.id] = self
         
@@ -700,7 +703,7 @@ class Select(Selectable):
         self.columns = util.OrderedProperties()
         self.froms = util.OrderedDict()
         self.use_labels = use_labels
-        self.id = id(self)
+        self.id = "Select(%d)" % id(self)
         self.name = None
         self.whereclause = whereclause
         self._engine = engine
index 3b006c220735cd1ba30cc72830448c98c2db50e1..2276ef554404a15c11dde44eca6bcc7cbc623420 100644 (file)
@@ -337,11 +337,6 @@ class DependencySorter(object):
             self.children = HashSet()
             self.parent = None
             self.circular = False
-        def append(self, node):
-            if node.parent is not None:
-                del node.parent.children[node]
-            self.children.append(node)
-            node.parent = self
         def __str__(self):
             return self.safestr({})
         def safestr(self, hash, indent = 0):
@@ -392,13 +387,11 @@ class DependencySorter(object):
                     del parentnode.children[c]
                 root.parent = parentnode
                 parentnode.children.append(root)
-                print str(parentnode)
         
         # now we have a collection of subtrees which represent dependencies.
         # go through the collection root nodes wire them together into one tree        
         head = None
         for node in nodes.values():
-            print "hi1:" + str(node)
             if node.parent is None:
                 if head is not None:
                     head.append(node)