[Zope] Objet : Re: [Zope] Locate an object in zope tree

Chris Withers chrisw@nipltd.com
Wed, 16 Feb 2000 15:28:28 +0000


> <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