diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-10 14:14:50 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-10 14:14:50 -0400 |
| commit | 14d2bb074cccdec32bd26a89353c30fd512b2aa2 (patch) | |
| tree | b8bea89172c620f0f015edd5359681e304a19ac6 /lib/sqlalchemy/orm | |
| parent | 706d4fcc4f69b74a502be41f5eea3fedd9413bc7 (diff) | |
| download | sqlalchemy-14d2bb074cccdec32bd26a89353c30fd512b2aa2.tar.gz | |
- Fixed bug in ordering list where the order of items would be
thrown off during a collection replace event, if the
reorder_on_append flag were set to True. The fix ensures that the
ordering list only impacts the list that is explicitly associated
with the object.
fixes #3191
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/collections.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py index 1fc0873bd..c2754d58f 100644 --- a/lib/sqlalchemy/orm/collections.py +++ b/lib/sqlalchemy/orm/collections.py @@ -589,6 +589,16 @@ class CollectionAdapter(object): "The entity collection being adapted." return self._data() + @property + def _referenced_by_owner(self): + """return True if the owner state still refers to this collection. + + This will return False within a bulk replace operation, + where this collection is the one being replaced. + + """ + return self.owner_state.dict[self._key] is self._data() + @util.memoized_property def attr(self): return self.owner_state.manager[self._key].impl |
