summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-07-04 20:01:55 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-07-04 20:01:55 -0400
commit3f75c6aff6e886e007c75d26e061987437b1bafb (patch)
treed9979bff7427b20e86bf215c11a63be9b84a1a4c /lib/sqlalchemy/orm/attributes.py
parent4a9d88b1cf1ba674f13b8e9c173aabd13b82dc36 (diff)
downloadsqlalchemy-3f75c6aff6e886e007c75d26e061987437b1bafb.tar.gz
Fixed bug whereby attribute history functions would fail
when an object we moved from "persistent" to "pending" using the :func:`.make_transient` function, for operations involving collection-based backrefs. [ticket:2773]
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r--lib/sqlalchemy/orm/attributes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 3eda127fd..7f1b5e58c 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -884,7 +884,7 @@ class CollectionAttributeImpl(AttributeImpl):
if self.key in state.committed_state:
original = state.committed_state[self.key]
- if original is not NO_VALUE:
+ if original not in (NO_VALUE, NEVER_SET):
current_states = [((c is not None) and
instance_state(c) or None, c)
for c in current]
@@ -1326,7 +1326,7 @@ class History(History):
return cls((), (), ())
current = getattr(current, '_sa_adapter')
- if original is NO_VALUE:
+ if original in (NO_VALUE, NEVER_SET):
return cls(list(current), (), ())
elif original is _NO_HISTORY:
return cls((), list(current), ())