I played with ZCatalog and ZClasses a time ago.
Due to the fact that ZCatalog can Index all Objects - You Can Index a
Method, .....!!!
This Methods can be External-, Phython-, or DTML-Methods.
But they have to return something to the catalog (DTML-RETURN Tag).
You can give this method a name like "PrincipiaSearchSource" or what the
hell you think of.

In my case I index about 10 different ZClass, 100 Instances of them, with a
PythonMethod called text_inhalt (text_contents)
Param: self
return string.join((self.id, self.inhalt), '; ')

Or in an  subclass
return string.join((self.id, self.teaser, self.gericht, self.keys, self.art,
self.norm, self.parteien), '; ')

Be warned you can use a DTML Method and return something with the
dtml-return tag, but this is not working very well within a ZCLass, !!!

If you want to call a resultObject (e.g. a ZClass) directly through
Zope/DTML/Python use the PyMethod "fetchObj" much cooler than only via
catalog.getpath (which is link /hfg/kkjk/)

to do somthing like this:

<dtml-in mein> ****Result from a canned search

)))">****convert /parent/child to an real object parent.child

<dtml-var meineURL>  *** points to a ZClass [Base:Renderable] calling the
Object/Class directly, which renders itself


use something like this:

Python Method: fetchObj

Param: _,fetchStr, attr=None

obj = _
for p in string.split(fetchStr, '/'):
   obj = obj[p]
if attr is None:
   return obj
   return render(_.getattr(obj, attr))

Greetings from Heidelberg

Michael Kobald

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to