Comment 0 for bug 98483

Revision history for this message
Philipp von Weitershausen (philikon) wrote :

Status: Pending => Accepted

 Supporters added: philikon

ObjectModifiedEvent is a general event to indicate some property/ies, whether intrinsic or extrinsic (e.g. in annotations), of an object has changed. In itself an ObjectModifiedEvent is pretty general therefore and hence quite useless to deduct within a subscriber how the object was modified. That's why there is actually support for annotating ObjectModified events with this information:

  info = Attributes(ITheSchema, 'foo', 'bar', 'blergh')
  notify(ObjectModifiedEvent(obj, info))

(Attributes is importable from zope.lifecycleevent). Note that the object must not necessarily provide ITheSchema, it could also be that the ITheSchema(obj) adapter was changed (this is useful when sending modified events for annotation adapters like IZopeDublinCore).

The problem is that Zope itself makes little use of this yet. In particular:

* zope.formlib doens't annotate events with this information, even though it has all that information (which exact properties changed). Interesting enough, zope.app.form *does* annotate the event with the additional info.

* The 'contents.html' view for containers allows you to change the DublinCore Title property, but doesn't send any event whatsoever (it should be sending an ObjecdtModifiedEvent with Attributes(IZopeDublinCore, 'title').

* The 'edit.html' view for zope.app.file's File objects sends ObjectModifiedEvents, but doesn't annotate it with the right kind of information)

There might be other cases lurking around. These are the ones I could find offhand.