Re: [Zope] ZCataloging without ZClasses
Please stay on the list... readded... massimop@users.berlios.de wrote at 2004-10-11 20:23 +0200:
... cataloguing objects ... now I know (I think) that I can use properties and call catalog_object to put objects in the ZCatalog, but this isn't explained in that chapter
It is not explained explicitely because it follows from basic principles: When an object "o" is indexed in an index "I", then "I" uses its name to obtain a value "v" from "o". The standard way is to use "o.I". If "o.I" is callable, it is called; otherwise, it is used directly -- in pseudo code: v = getattr(o, I.getId()) if callable(v): v = v() This means that you can use anything that can be accessed in the form "o.I" or "o.I()". Properties, properties in PropertySheets (ZClasses) either of the object itself or acquired and methods, PythonScripts either on the object itself or acquired can be used to integrate the object with the ZCatalog. -- Dieter
On Tue, 2004-10-12 at 19:11 +0200, Dieter Maurer wrote:
Please stay on the list... readded... sorry, it wasn't intentional
massimop@users.berlios.de wrote at 2004-10-11 20:23 +0200:
... cataloguing objects ... now I know (I think) that I can use properties and call catalog_object to put objects in the ZCatalog, but this isn't explained in that chapter
It is not explained explicitely because it follows from basic principles:
When an object "o" is indexed in an index "I", then "I" uses its name to obtain a value "v" from "o".
The standard way is to use "o.I". If "o.I" is callable, it is called; otherwise, it is used directly -- in pseudo code:
v = getattr(o, I.getId()) if callable(v): v = v()
This means that you can use anything that can be accessed in the form "o.I" or "o.I()".
Properties, properties in PropertySheets (ZClasses) either of the object itself or acquired and methods, PythonScripts either on the object itself or acquired can be used to integrate the object with the ZCatalog.
please be patient (my english skill is giving a hard time...) the indexing of properties was clear (somewhat...) to me what I missed was a way to (re)index programmatically an object, but I could as well have misred; if that's the case, I apologize.... thanks massimo
massimop@users.berlios.de wrote at 2004-10-12 22:13 +0200:
... what I missed was a way to (re)index programmatically an object, but I could as well have misred; if that's the case, I apologize....
You use "catalog_object" for both the initial indexing as well as any reindexing. -- Dieter
participants (2)
-
Dieter Maurer -
massimop@users.berlios.de