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

Dominik Huber dominik.huber at perse.ch
Thu Nov 17 11:32:29 EST 2005


Johan Carlsson wrote:

> Dominik Huber wrote:
>
>> Hi Johan
>> Your problem is that the catalog is not locatable itself during the 
>> addition of its indexes (-> state within the create and add method), 
>> therefore the location of the indexes cannot be located and the 
>> NotYetError is raised. You can move your code to an 
>> ObjectAddedEvent-subscriber for your object.
>>
>>  <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)
>
>
> I've tried this, it doesn't remove the NotYet problem though!??

Our framework relies on that concept and it is still working ;)
Did you assert  to add the catalog to the sitemanagement folder before 
adding its indexes?

Dominik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominik.huber.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051117/fc43f1ef/dominik.huber.vcf


More information about the Zope3-users mailing list