summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-06-15 14:04:13 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-06-15 14:04:13 -0400
commit27b9b3578ddf421f990cd7a2ab7c9635178b210b (patch)
tree36ea0dc0c51ddf5e2ad440977fd9b6f91b53b9b0 /lib/sqlalchemy
parent1769b2d8deb8aa97c6f8df500c1355f4206d1484 (diff)
downloadsqlalchemy-27b9b3578ddf421f990cd7a2ab7c9635178b210b.tar.gz
- Can now call make_transient() on an instance that
is referenced by parent objects via many-to-one, without the parent's foreign key value getting temporarily set to None - this was a function of the "detect primary key switch" flush handler. It now ignores objects that are no longer in the "persistent" state, and the parent's foreign key identifier is left unaffected.
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/dependency.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py
index ba2ae8889..7a8c4cf70 100644
--- a/lib/sqlalchemy/orm/dependency.py
+++ b/lib/sqlalchemy/orm/dependency.py
@@ -776,7 +776,7 @@ class DetectKeySwitch(DependencyProcessor):
uowcommit, self.passive_updates)
def _pks_changed(self, uowcommit, state):
- return sync.source_modified(uowcommit,
+ return state.has_identity and sync.source_modified(uowcommit,
state,
self.mapper,
self.prop.synchronize_pairs)