Objet : Re: [Zope] Locate an object in zope tree
Thanks all for suggestions. <dtml-with "PARENTS[-1].folder1.object1"> works. That's great but in PARENTS[-1] is still a mystery, particulary '-1' !! FR
<dtml-with "PARENTS[-1].folder1.object1"> works. That's great but in PARENTS[-1] is still a mystery, particulary '-1' !!
PARENTS is a Python list of Zope objects. PARENTS[0] is the parent of the current object, usually the folder the object is in, PARENT[1] is that object's parent, etc, etc. So, the root object is the last object in this list. [-1] is a nice little piece of syntax that points to the last item in a list. It's not pretty, but it works, I wonder if we couldn't have a ROOT object instead? How about being able to define this so that if you had more than one site per Zope installation, you could set ROOT as appropriate? Hmm, I wonder about setting this as a folder property... Ideas, anyone? Chris
participants (2)
-
Chris Withers -
Francois-Regis CHALAOUX