summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-05-13 15:53:18 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-05-13 15:53:18 -0400
commit14d523265203d21152411b5f3c18843b09b23554 (patch)
tree7611c05ad118f23df00d69606bc16a553beec2ff /lib/sqlalchemy/sql/util.py
parentf0fa460791735cd27dc41b1ed154465ea2441be5 (diff)
downloadsqlalchemy-14d523265203d21152411b5f3c18843b09b23554.tar.gz
- Added table.add_is_dependent_on(othertable), allows manual
placement of dependency rules between two Table objects for use within create_all(), drop_all(), sorted_tables. [ticket:1801]
Diffstat (limited to 'lib/sqlalchemy/sql/util.py')
-rw-r--r--lib/sqlalchemy/sql/util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index e4ebe9538..14ea42d2c 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -22,6 +22,11 @@ def sort_tables(tables):
visitors.traverse(table,
{'schema_visitor':True},
{'foreign_key':visit_foreign_key})
+
+ tuples.extend(
+ [parent, table] for parent in table._extra_dependencies
+ )
+
return list(topological.sort(tuples, tables))
def find_join_source(clauses, join_to):