diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-04-14 18:11:54 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-04-14 18:11:54 +0000 |
| commit | 56feb8d900c1412b8301a74bee1a3a82b1c2642f (patch) | |
| tree | b875f056b3aef3a4a96900b4530cdbd6e8673c6f /lib/sqlalchemy | |
| parent | 4022b1359d30daa7b7fcb0fbc8e7a4e2ac4b0551 (diff) | |
| download | sqlalchemy-56feb8d900c1412b8301a74bee1a3a82b1c2642f.tar.gz | |
had to take out the "treeification" of the dependency sort as it doenst really work , added test conditions to the dependency test + the original test that failed
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/mapping/topological.py | 9 | ||||
| -rw-r--r-- | lib/sqlalchemy/mapping/unitofwork.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql.py | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/sqlalchemy/mapping/topological.py b/lib/sqlalchemy/mapping/topological.py index 95807bf5f..779faab2d 100644 --- a/lib/sqlalchemy/mapping/topological.py +++ b/lib/sqlalchemy/mapping/topological.py @@ -141,15 +141,16 @@ class QueueDependencySorter(object): #print repr(output) head = None node = None + # put the sorted list into a "tree". this is not much of a + # "tree" at the moment as its more of a linked list. it would be nice + # to group non-dependent nodes into sibling nodes, which allows better batching + # of SQL statements, but this algorithm has proved tricky for o in output: if head is None: head = o - node = o else: - for x in node.children: - if x.dependencies.has_key(o): - node = x node.children.append(o) + node = o return head def _add_edge(self, edges, edge): diff --git a/lib/sqlalchemy/mapping/unitofwork.py b/lib/sqlalchemy/mapping/unitofwork.py index 3ef1d96ae..873bed548 100644 --- a/lib/sqlalchemy/mapping/unitofwork.py +++ b/lib/sqlalchemy/mapping/unitofwork.py @@ -422,7 +422,6 @@ class UOWTransaction(object): mappers = util.HashSet() for task in self.tasks.values(): mappers.append(task.mapper) - head = DependencySorter(self.dependencies, mappers).sort(allow_all_cycles=True) #print str(head) task = sort_hier(head) diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 7129781a7..b18b0916e 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -917,7 +917,6 @@ class Join(FromClause): def __init__(self, left, right, onclause=None, isouter = False): self.left = left self.right = right - # TODO: if no onclause, do NATURAL JOIN if onclause is None: self.onclause = self._match_primaries(left, right) @@ -925,6 +924,8 @@ class Join(FromClause): self.onclause = onclause self.isouter = isouter + name = property(lambda self: "Join on %s, %s" % (self.left.name, self.right.name)) + def _locate_oid_column(self): return self.left.oid_column |
