[Zope3-Users] Re: Events

David Johnson djohnson at jsatech.com
Thu Feb 22 07:37:13 EST 2007


>
> You're probably talking about dispatchToSublocations. This is the  
> code that looks up a containers sublocations and dispatches the  
> event to them.
>
> One way to prevent this behaviour for your container is to write a  
> new ISublocations adapter for your container that simply returns an  
> empty sequence:
>
>   class MyContainerSublocations(object):
>       implements(zope.location.interfaces.ISublocations)
>       adapts(...IMyContainer)
>
>       def __init__(self, context):
>           self.context = context
>
>       def sublocations(self):
>           return ()
This is probably the approach I will follow, but what if I want my  
container objects notified? Even if I don't it seems the default  
Folder implementation follows this logic and so if you have a folder  
with several large images for example, then you will pay a price  
whenever an event is issued.  In general it seems that any change  
will result in the entire ZODB being read for each event  
dispatch...if I still follow the logic here.

--
David










More information about the Zope3-users mailing list