[Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Johan Carlsson
johanc at easypublisher.com
Thu Nov 17 11:26:01 EST 2005
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!??
Regards,
Johan
--
Johan Carlsson Tel: + 46 8 31 24 94
Colliberty Mob: + 46 70 558 25 24
Torsgatan 72 Email: johanc at easypublisher.com
SE-113 37 STOCKHOLM
More information about the Zope3-users
mailing list