From 14d523265203d21152411b5f3c18843b09b23554 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 13 May 2010 15:53:18 -0400 Subject: - 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] --- lib/sqlalchemy/sql/util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sqlalchemy/sql') 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): -- cgit v1.2.1