[Zope] Catalog question

Dieter Maurer dieter@handshake.de
Tue, 3 Dec 2002 21:18:56 +0100


Kevin Carlson writes:
 > Is it possible using an expression to disallow an object being added to a
 > catalog based on a certain string being contained in its path?  For example,
 > I want to include all objects in a subfolder except if the path includes the
 > name 'sample' in the path.
 > 
 > I think this may be possible utilizing the "expr" field on the Find Objects
 > tab of a ZCatalog, but I'm not certain how to write the expression.  Can
 > anyone offer some advice?
I solve problems of this kind with the following two step approach:

  *  determine the list of objects in any appropriate way.
     My favorite is "ZopeFind" (the method behind Zope's "find" tab).

  *  Interate over the list and call "Catalog.catalog_object"
     for each object.


Dieter