[Zope] use of objectValues() in DTML Methods vs. DTML Documents

Ron Bickers rbickers@logicetc.com
Wed, 25 Oct 2000 12:10:23 -0400


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Mike
> Bannister
> Sent: Wednesday, October 25, 2000 5:44 AM
> To: zope@zope.org
> Subject: [Zope] use of objectValues() in DTML Methods vs. DTML Documents

> Just for the heck of it I dropped that same code into a DTML
> Document in the
> same Folder and it didn't list the Files as I had expected. I understand
> pretty much the differences of Methods and Documents and I'm assuming the
> reason for this is related to the way the Documents exists in it's own
> namespace and the Method doesn't... so my best guess for this behavior is
> that the 'scope' of objectValues() is limited to the current namespace.
>
> Am I even close? If not can someone explain this to me?

That's basically it, yes.

I think of a method as being a function that works on the object it is "in",
and a document as being an object that gets worked on.  So objectValues() in
a method will return objects from its container, whereas objectValues() in a
document will always return objects from within that document.

Acquisition plays a role too, since a method can work in different contexts.

For example (given myMethod and myDocument that both use objectValues())

TestFolder1.myMethod will return objects in TestFolder1
TestFolder2.myMethod will return objects in TestFolder2

TestFolder1.myDocument will return objects in myDocument
TestFolder2.myDocument will return objects in myDocument

I hope this makes sense.

_______________________

Ron Bickers
Logic Etc, Inc.
rbickers@logicetc.com