[Zope3-dev] Sublocation notifications

Garrett Smith garrett at mojave-corp.com
Tue May 3 17:39:18 EDT 2005


We currently dispatch some object events to sublocations. I think
there's a problem with the current approach.

If I subscribe to IObjectModifiedEvent with something like this:

  def handle(object, event):
       ...

I'll get notifications where object and event.object are different. This
happens for sublocation dispatches. This was very surprising, but it
makes sense -- there are cases when you'd want to get notifications like
that.

But most of my code looks like this:

  def handle(object, event):
      # ignore Zope's sublocation dispatches
      if object != event.object:
          return
      ...

I propose that we dispatch using both the original object and the
sublocation, along with the event. Handlers for these sublocation
dispatches would then look like this:

  def handle(object, sublocation, event):
      ...

 -- Garrett


More information about the Zope3-dev mailing list