ObjectRemovedEvent is sent *before* the object is removed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BlueBream |
New
|
Undecided
|
Unassigned | ||
Zope 3 |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
The ObjectRemovedEvent is fired when an contained item is removed from its container.
The current container implementations in zope.app.container fire this event *before* actually removing the item. Subscribers to this event will thus find the item still in its container (for example through the oldParent attribute on the event object).
So either the event's name is misleading and should be something like "ObjectAboutToB
The latter solution would need a bit of work, since the helper functions (in zope.app.
Changed in zope3: | |
status: | New → Won't Fix |
I'm sure there's a way to say "Not a bug" or "Won't fix" in Launchpad, but I can't find it in this UI.
This has always been this way; the behavior can't be changed; that would be a backward compatibility failure. I vaguely recall this being discussed when this was first designed, and it was decided this was reasonable *because* subscribers would want to be able to use __parent__.
If you really need both the existing event *and* ObjectHasAlread yBeenRemoved, present a feature request with a use case. Seems unlikely to be valuable IMO.