[Zope3-dev] UniqueIdUtility question

Jim Fulton jim at zope.com
Wed Nov 10 17:24:03 EST 2004


Dominik Huber wrote:
> If nested objects are deleted, only the most parental
> deletion is notified by a IObjectRemovedEvent.

Wrong.

> Therefore only the most parental is deregistered from the
> UniqueIdUtility.
> Its sub-objects are orphans and still registered. Bug or feature?

Bug.  The unique id utility's subscribers aren't set up to get the
proper notifications.  Unfortunately, the uniqueid utility also defines
an event framework for notifying catalogs that reflects a lack of
understanding of how location events are handled. (I'm sure that
this missunderstanding is widespread.)

When a location relevent event is dispatched for an object, it is
redispatched to the object and each of it's subobjects. A subscriber that
wants to be called for objects and subsobjects should be of the form:

def foo(ob, event):
    ....

and should be registered for ILocation and the event type.
The first argument will be different than the second argument's
'object' attribute if first argument is a subobject.

I'll fix this.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list