[Zope3-dev] Missing ObjectContentModifiedEvent

Garrett Smith garrett at mojave-corp.com
Tue May 3 10:40:24 EDT 2005


>From the interface docs, it's not clear to me what the difference
between the events are:

class IObjectModifiedEvent(IObjectEvent):
    """An object has been modified""

class IObjectContentModifiedEvent(IObjectModifiedEvent):
    """An object's content has been modified"""

What is the difference between 'content' that gets modified and the
object that gets modified.

How might I interpret receiving both events for a 'modify' operation on
the same operation?

 -- Garrett


Jim Fulton wrote:
> Uwe Oestermeier wrote:
>> Hi,
>> 
>> I'm working on a versioning system that creates a new version for
>> each changed file content. I tried to listen  to
>> zope.app.event.interfaces.IObjectContentModifiedEvents,
>> but unfortunately no such event seems to be generated.
>> 
>> Editing an existing zope.app.file.File via the edit view leads only
>> to an ObjectModifiedEvent, uploading new content produces no object
>> event at all. 
>> 
>> Should this be fixed by generating ObjectContentModifiedEvents in
>> both cases (which I would prefer),
> 
> Yes.
> 
>> or should the less informative ObjectModifiedEvent be used? In the
>> later case, the misleading IObjectContentModifiedEvent should
>> probably removed from the list of objectevents. 
>> 
>> In general, missing events are difficult to detect and I'm quite sure
>> that file editing and uploading
>> are not the only relevant cases (e.g. WebDAV and FTP are other ways
>> to modify file contents). Wouldn't it be the best solution to
>> generate an IObjectContentModifiedEvent in the File._setData method
>> and not the view classes?
> 
> I think this would be OK for this specific case.
> 
> What I don't want to see is some general implicit event-generation
> scheme.
> 
> Jim



More information about the Zope3-dev mailing list