diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-04 20:01:55 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-04 20:02:31 -0400 |
| commit | 806f5a4183681582f1baabe02e7c5b4473c294ff (patch) | |
| tree | 3803ea361e56052533fd19d3515486ce1473c57a /lib/sqlalchemy | |
| parent | f390639bf1a7a5a2a47bcd6df7106cf5855a44c1 (diff) | |
| download | sqlalchemy-806f5a4183681582f1baabe02e7c5b4473c294ff.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')
| -rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 2627a1c44..a4e5977a9 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -881,7 +881,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] @@ -1324,7 +1324,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), ()) |
