ZCatalog: how to only catalog items with a specific property?
Hi fellow Zopists, 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')" did not work... i'm lost, even looking at those source didn't help... Any guru around? Thanks in advance, Philipp Robbel
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
participants (2)
-
Dieter Maurer -
Philipp Robbel