From 82b6e074920cb972a569db4d2d395c8949868a31 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 1 Apr 2013 13:37:35 -0400 Subject: - Fixed bug in unit of work whereby a joined-inheritance subclass could insert the row for the "sub" table before the parent table, if the two tables had no ForeignKey constraints set up between them. Also in 0.7.11. [ticket:2689] - fix a glitch in the assertsql.CompiledSQL fixture regarding when a multiparam compiledSQL is used within an AllOf - add a new utility function randomize_unitofwork() which does the function of --reversetop --- lib/sqlalchemy/sql/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/util.py') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 27ba0f95b..520c90f99 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -13,12 +13,14 @@ from collections import deque """Utility functions that build upon SQL and Schema constructs.""" -def sort_tables(tables, skip_fn=None): +def sort_tables(tables, skip_fn=None, extra_dependencies=None): """sort a collection of Table objects in order of their foreign-key dependency.""" tables = list(tables) tuples = [] + if extra_dependencies is not None: + tuples.extend(extra_dependencies) def visit_foreign_key(fkey): if fkey.use_alter: -- cgit v1.2.1