summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-04-11 20:20:38 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-04-11 20:20:38 +0000
commit99d3e251cf6f24807138ef03cdd0f7c55b00e810 (patch)
treedde7c89047c86979c318bab9068fab3b996a9dc1 /lib
parent014377038491b412d72ca19815b8dd7696e76b2a (diff)
downloadsqlalchemy-99d3e251cf6f24807138ef03cdd0f7c55b00e810.tar.gz
- Fixed a unit of work issue whereby the foreign
key attribute on an item contained within a collection owned by an object being deleted would not be set to None if the relation() was self-referential. [ticket:1376]
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/unitofwork.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py
index 8ad889820..4ac9c765e 100644
--- a/lib/sqlalchemy/orm/unitofwork.py
+++ b/lib/sqlalchemy/orm/unitofwork.py
@@ -720,6 +720,10 @@ class UOWExecutor(object):
def execute_save_steps(self, trans, task):
self.save_objects(trans, task)
+ for dep in task.polymorphic_cyclical_dependencies:
+ self.execute_dependency(trans, dep, False)
+ for dep in task.polymorphic_cyclical_dependencies:
+ self.execute_dependency(trans, dep, True)
self.execute_cyclical_dependencies(trans, task, False)
self.execute_dependencies(trans, task)
@@ -735,7 +739,5 @@ class UOWExecutor(object):
self.execute_dependency(trans, dep, True)
def execute_cyclical_dependencies(self, trans, task, isdelete):
- for dep in task.polymorphic_cyclical_dependencies:
- self.execute_dependency(trans, dep, isdelete)
for t in task.dependent_tasks:
self.execute(trans, [t], isdelete)