[Zope-CMF] Cannot index ZClass properties

Dieter Maurer dieter@handshake.de
Sun, 21 Jul 2002 23:13:15 +0200


S Haldar writes:
 > I need to index ZClass properties with the
 > portal_catalog. I am not able to do that. Everytime
 > these index values come up as blank in the catalog
 > entry while they are getting populated in the actual
 > Object instance. Can anyone show me the light? Here's
 > what I am doing:
 > 
 > ==========================
 > The properties to be indexed are "City" and
 > "District". 
 > 
 > So in portal_catalog metadata I created two entries of
 > the same name. I also created two indexes with the
 > respective names and type "FieldIndex".
 > 
 >  
 > My Object class is subclassed from CatalogAware
 > 
 > In my object instance creation script I use the
 > following two lines:
 >     
 > thisObj.propertysheets.tbProperties.manage_changeProperties
 > ({'Customer_Name':custs.Ship_To_Name,
 > 'Customer_Address':custs.Street, 'City':custs.City,
 > 'State':custs.State, 'Zip':custs.Zip,
 > 'District':custs.District})
 > 
 > 
 > thisObj.reindexObject()
 > =====================================
 > 
 > This doesn't work.
The stock "CatalogAware" looks for a catalog call "Catalog"
but inside CMF the catalog is "portal_catalog".

Recently, I read some messages mentioning "CMFCatalogAware".
Probably, you should use that.
Provide it as an allowed ZClass base, if necessary.


Dieter