[Zope] ZCatalog programatically? Or ZClass with ZCatalog base?

Kevin Dangoor kid@kendermedia.com
Mon, 4 Oct 1999 09:41:04 -0400


-----Original Message-----
From: Stuart 'Zen' Bishop <zen@cs.rmit.edu.au>
To: zope@zope.org <zope@zope.org>
Date: Monday, October 04, 1999 5:57 AM
Subject: [Zope] ZCatalog programatically? Or ZClass with ZCatalog base?


>In my main container class' constructor, I seem to be unable to
>create a ZCatalog instance (manage_addZCatalog gives a name error, and
>it doesn't appear in the method lists in my patched online help). Is it
>possible to create a ZCatalog object from a ZClass constructor?

It should be. Inside the <dtml-with "createInObjectManager"> part of the
constructor, you can probably do (untested):

<dtml-with "manage_addProduct['ZCatalog']">
 <dtml-call "manage_addZCatalog('id', 'title')">
</dtml-with>

I haven't used this syntax for a python Product before, so I'm not sure if
this will work as is. It should be a step in the right direction though.
(You can tell by looking at the source for the Add list within the
management screen.)

Kevin