summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dependency.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-05-30 01:32:53 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-05-30 01:32:53 -0400
commit69dbcdd0ebf8de81643c038276fcc822a7b0bd0b (patch)
treeb6cc4a9e12f8ac04b164068d4df8096475b755e2 /lib/sqlalchemy/orm/dependency.py
parent2c8689fd141c278a7bbc250087e553b76a515bc6 (diff)
downloadsqlalchemy-69dbcdd0ebf8de81643c038276fcc822a7b0bd0b.tar.gz
- Related to :ticket:`3060`, an adjustment has been made to the unit
of work such that loading for related many-to-one objects is slightly more aggressive, in the case of a graph of self-referential objects that are to be deleted; the load of related objects is to help determine the correct order for deletion if passive_deletes is not set. - revert the changes to test_delete_unloaded_m2o, these deletes do in fact need to occur in the order of the two child objects first.
Diffstat (limited to 'lib/sqlalchemy/orm/dependency.py')
-rw-r--r--lib/sqlalchemy/orm/dependency.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py
index 68ae0a0e4..40d6bd776 100644
--- a/lib/sqlalchemy/orm/dependency.py
+++ b/lib/sqlalchemy/orm/dependency.py
@@ -154,12 +154,16 @@ class DependencyProcessor(object):
parent_in_cycles = True
# now create actions /dependencies for each state.
+
for state in states:
# detect if there's anything changed or loaded
- # by a preprocessor on this state/attribute. if not,
- # we should be able to skip it entirely.
+ # by a preprocessor on this state/attribute. In the
+ # case of deletes we may try to load missing items here as well.
sum_ = state.manager[self.key].impl.get_all_pending(
- state, state.dict)
+ state, state.dict,
+ self._passive_delete_flag
+ if isdelete
+ else attributes.PASSIVE_NO_INITIALIZE)
if not sum_:
continue