[Zope-CMF] Workflow and zcatalog and zclasses

Chris Withers chrisw@nipltd.com
Sun, 28 Jul 2002 09:41:17 +0100


S Haldar wrote:
> It turns out that all I had to do was to change the
> default catalog before reindexing the ZClass instance.
> 
> 2. If the ZClass instance is programatically
> created,it should have been subclassed from
> CatalogPathAware (or CatalogAware for Zope versions
> below 2.5.1). While defining the ZClass, the
> CatalogPathAware should be the FIRST base class.  
> 
> Just after the object instance is created, change the
> name of the default catalog (which happens to be
> "Catalog") to that of your Catalog ("portal_catalog"
> in my case). After this, reindex the object.
> 
> thisObject.manage_editCataloger('portal_catalog')
> .....
> thisObject.reindexObject()
> 
> This will ensure that the Zclass indexes in the
> catalog's brain object get the correct values.

...more reasons why ZClasses suck ;-)

I would have used a Scriptable Type Information object and had lots of 
calls to addProperty in the constructor script. No need for all the 
above malarky...

cheers,

Chris