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
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to