[Zope3-Users] Anyone had any success with ZCatalog in Zope 3?

Tom Dossis td at yoma.com.au
Thu Nov 17 17:26:13 EST 2005


Dominik Huber wrote:
> 
>  <subscriber
>      for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent"
>      handler=".addCatalogAndIndex"
>      />
> 
> handler pseudo code:
> 
> def addCatalogAndIndex(obj, event):
>    sm = zapi.getNextSiteManager(obj)
>    catalog = Catalog()
>    addLocalUtility(sm, 'XY', ICatalog, catalog)
>    catalog[name] = Index(name, IAnyInterface)
> 
> Regards,
> Dominik


 From the apidoc for IWriteContainer.__setitem__(name, object)
it states..

''If an add event is generated and the object can be adapted to 
IObjectAddedEvent, then the adapter's addNotify method is called with 
the event.''

This could be alternative way to implement the the subscriber solution 
above.  However, from looking at the code (Zope3.1) it doesn't seem to 
to what the apidoc claims.

Does anybody know if this is still intended?

-Tom


More information about the Zope3-users mailing list