[Zope3-Users] Re: ObjectModifiedEvent but not ContainerModifiedEvent

Martin Aspeli optilude at gmx.net
Fri Aug 17 18:51:50 EDT 2007


Chris Withers wrote:
> Hey All,
> 
> How do I subscribe a susbcriber to ObjectModifiedEvent but not 
> ContainerModifiedEvent?
> 
> I have a subscriber that is currently subscribed to 
> IObjectModifiedEvent, but as a result it's getting called when objects 
> are added and removed whereas I only want it when the container is 
> actually getting modified.

def handler(event):
     if IContainerModifiedEvent.providedBy(event):
         return

Martin

-- 
Acquisition is a jealous mistress



More information about the Zope3-users mailing list