summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-04-14 18:11:54 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-04-14 18:11:54 +0000
commit56feb8d900c1412b8301a74bee1a3a82b1c2642f (patch)
treeb875f056b3aef3a4a96900b4530cdbd6e8673c6f /lib/sqlalchemy/mapping
parent4022b1359d30daa7b7fcb0fbc8e7a4e2ac4b0551 (diff)
downloadsqlalchemy-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/mapping')
-rw-r--r--lib/sqlalchemy/mapping/topological.py9
-rw-r--r--lib/sqlalchemy/mapping/unitofwork.py1
2 files changed, 5 insertions, 5 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)