[Zope3-Users] Create catalog index via script

Florian Lindner mailinglists at xgm.de
Sun Jun 18 07:06:12 EDT 2006


Am Samstag, 17. Juni 2006 10:38 schrieb Achim Domma:
> Hi,
>
> I have a workspace object, which I initialize in the
> IObjectCreatedEvent. I try to add a catalog with an index like this:
>
> ensureUtility(workspace,zope.app.intid.interfaces.IIntIds,'',IntIds,asObjec
>t=True)
> catalog=ensureUtility(workspace,zope.app.catalog.interfaces.ICatalog,'',Cat
>alog,asObject=True) catalog["tmp"]=CategoryIndex()
>
> workspace derives from Folder and is already a Site at this point. The
> last line causes the following error:
>
> ComponentLookupError: (<InterfaceClass
> zope.app.intid.interfaces.IIntIds>, '')
>
> If I remove the line, it works fine. I can see the Catalog in my
> Workspace and can add the CategoryIndex without problem!?
>
> Seems like I'm missing something in the setup of the IIntIds utility,
> but I have no idea what it is.

I assume that you have made workspace a site before? How does that code look 
like? Do you have this expression:

            hooks.setSite(workspace)

Without that expression I used to have the same error.

Regards,

Florian


More information about the Zope3-users mailing list