[Zope3-Users] IObjectModifiedEvent

Marco Mariani marco at sferacarta.com
Thu Jun 1 12:04:11 EDT 2006


I'm using 3.3 beta 1.

I've never used events.

I've subscribed to modification events on my objects:

  <subscriber for=".interfaces.IMyObject
                   zope.lifecycleevent.interfaces.IObjectModifiedEvent"
              handler=".events.modifiedObject" />



Unfortunately, modifiedObject() only gets called when new children are
inserted (IMyObject provides IContainer)

I do NOT get an event for changing an attribute on a MyObject instance
or for trying the same on other objects that do not implement IContainer.



I've also tried to set up the following catch-all handler:


  <subscriber
          for="zope.lifecycleevent.interfaces.IObjectModifiedEvent"
          handler=".events.modifiedObject" />


def modifiedObject(event):
    print 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
    print 'Event: ', event
    print 'Object: ', event.object


and upon restarting zope, I get tons of events, all of them related to
zope.app.container.contained.ContainerModifiedEvent



Some pointer?

tnx



More information about the Zope3-users mailing list