[Zope] ZCataloging without ZClasses

bruno modulix bruno at modulix.org
Mon Oct 11 07:39:04 EDT 2004


massimop at users.berlios.de wrote:
> On Sun, 2004-10-10 at 23:02 +0200, Dieter Maurer wrote:
> 
>>massimop at users.berlios.de wrote at 2004-10-9 18:30 +0200:
>>
>>>being the use of ZClasses frequently discouraged, I was wondering if
>>>there is any way to dynamically add or reindex objects in a ZCatalog or
>>>if there is any alternative.
>>
>>You can dynamically add and reindex objects in a ZCatalog.
>>
>>Look at the methods "ZCatalog" provides (almost surely,
>>the methods are described in the Zope Book (2.6/2.7 edition, online)
>>as well).
>>
> 
> thanks for the answer
> 
> the chapter 'Searching and Categorizing Content' of the ZopeBook seems
> to rely on ZClasses, but you made me recall of the API Reference in
> Appendix, in which there's a method called 'catalog_object'

Well, there is an even simplest way : having your Product's class(es) 
implementing ZCatalog.CatalogPathAwareness.CatalogPathAware.

If you need to redefine the manage_afterAdd() and manage_beforeDelete() 
methods, don't forget to first call inheritedAttribute(...) before. Else 
it should do the stuff right out of the box.

HTH
Bruno
-- 
Bruno Desthuilliers - Analyste-programmeur
bruno at modulix.org
www.modulix.com



More information about the Zope mailing list