[Zope] Recursive method (Funny-peculiar)

Kevin Dangoor kid@kendermedia.com
Sun, 22 Aug 1999 10:56:56 -0400


Hi,

-----Original Message-----
From: Roché Compaan <sparroy@adept.co.za>
To: Michel Pelletier <michel@digicool.com>; Zope <zope@zope.org>
Date: Sunday, August 22, 1999 10:40 AM
Subject: RE: [Zope] Recursive method (Funny-peculiar)


>It is still peculiar to me why "Objectvalues('Folder')" has no values when
>you call it from a dtml document but has values when you call it from a
dtml
>method.  Why is this the case?

You have hit upon the difference between a DTML Document and a DTML Method.
A DTML Document has its own namespace. That means that any properties you
reference are looked up in the Document first. A DTML Method uses the
namespace of its container. So, with the DTML Document, when you call
"objectValues('Folder')", it is looking for Folders within the Document.
(Which you won't have, because DTML Documents are not object containers).
When you call "objectValues('Folder')" from a DTML Method, the objects
within the Folder itself are looked up.

There is more of a discussion of this at:
http://zdp.zope.org/FAQ/product_builtin

Kevin