summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-03-31 15:12:29 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-03-31 15:12:29 -0400
commit03fecba81969015afce99ebb8209a5e8a7988b34 (patch)
tree7c447ae94802fd4a30e9dfca6c15c1a62bd874cd /lib/sqlalchemy/sql
parent97ed8d47951d7777f2dd72a7f960d46bf833c0d3 (diff)
downloadsqlalchemy-03fecba81969015afce99ebb8209a5e8a7988b34.tar.gz
really got topological going. now that we aren't putting fricking mapped objects into
it all that id() stuff can go
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/util.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index d5575e0e7..4c59f50d5 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -15,10 +15,13 @@ def sort_tables(tables):
parent_table = fkey.column.table
if parent_table in tables:
child_table = fkey.parent.table
- tuples.append( ( parent_table, child_table ) )
+ if parent_table is not child_table:
+ tuples.append((parent_table, child_table))
for table in tables:
- visitors.traverse(table, {'schema_visitor':True}, {'foreign_key':visit_foreign_key})
+ visitors.traverse(table,
+ {'schema_visitor':True},
+ {'foreign_key':visit_foreign_key})
return topological.sort(tuples, tables)
def find_join_source(clauses, join_to):