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

But most of my code looks like this:

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

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
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to