summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/collections.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/collections.py')
-rw-r--r--lib/sqlalchemy/orm/collections.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py
index 5638a7e4a..4ca4c5719 100644
--- a/lib/sqlalchemy/orm/collections.py
+++ b/lib/sqlalchemy/orm/collections.py
@@ -472,6 +472,7 @@ class CollectionAdapter(object):
"""
def __init__(self, attr, owner_state, data):
self.attr = attr
+ # TODO: figure out what this being a weakref buys us
self._data = weakref.ref(data)
self.owner_state = owner_state
self.link_to_self(data)
@@ -578,7 +579,7 @@ class CollectionAdapter(object):
"""
if initiator is not False and item is not None:
- return self.attr.fire_append_event(self.owner_state, item, initiator)
+ return self.attr.fire_append_event(self.owner_state, self.owner_state.dict, item, initiator)
else:
return item
@@ -591,7 +592,7 @@ class CollectionAdapter(object):
"""
if initiator is not False and item is not None:
- self.attr.fire_remove_event(self.owner_state, item, initiator)
+ self.attr.fire_remove_event(self.owner_state, self.owner_state.dict, item, initiator)
def fire_pre_remove_event(self, initiator=None):
"""Notify that an entity is about to be removed from the collection.
@@ -600,7 +601,7 @@ class CollectionAdapter(object):
fire_remove_event().
"""
- self.attr.fire_pre_remove_event(self.owner_state, initiator=initiator)
+ self.attr.fire_pre_remove_event(self.owner_state, self.owner_state.dict, initiator=initiator)
def __getstate__(self):
return {'key': self.attr.key,