[Zope] ZCatalog: how to only catalog items with a specific property?

Dieter Maurer dieter@handshake.de
Thu, 23 Aug 2001 21:28:54 +0200 (CEST)


Philipp Robbel writes:
 > I'm trying to figure out how to only select certain DTMLDocuments with a
 > specific property into the ZCatalog via the "Find Objects" Screen.
 > 
 > On that Find Objects screen there's a field called "expr" .. it somehow
 > works because entering "1 == 1" selected every DTML Document while "1 == 2"
 > selected none. My problem is that I couldn't figure out the valid statement
 > for selecting only Documents with the certain property "NON_CATALOGED" not
 > set.
 > 
 > "hasattr(self,'NON_CATALOGED')"
Something like:

	  "getProperty('NON_CATALOGED')"

You need to look up the details in Zope's Online Help --> API-Documentation
--> PropertyManager.

It may be necessary to provide a default value to avoid an exception,
e.g.


Dieter