> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike
> Bannister
> Sent: Wednesday, October 25, 2000 5:44 AM
> 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.

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

Reply via email to