[Zope] Accessing Documents/Methods/Properties from within External Methods.

Daryl Tester dt@picknowl.com.au
Mon, 17 Apr 2000 11:14:23 +0930


Daryl Tester wrote:

>     doc = self.getattr('standard_html_header')    # Easy enough

Oops, that's a typo - should learn to cut 'n' paste.  It should read:

      doc = getattr(self, 'standard_html_header')  # Not as easy as I thought
>     res.append(doc(self, REQUEST))
> 
> Can of worms time.  I feel uneasy with the parameters to
> standard_html_header, as with the examples from DTML it is usually
> called with (_.None, _), so I've tried (None, self) as parameters
> as well.  Both work.

I've found the source of my confusion at least.  In the "Using
External Methods" HowTo, the author is using the following form
to retrieve DTML documents

    doc = getattr(self, docname)
    return doc(self, REQUEST)

But I still can't find any other document that supports this view,
and calling the document with (None, self) works (as I'm presuming
that self is the folder containing the method, which should equate
to the namespace stack - will this include REQUEST though?).

Auugh!  As someone else put it, "the sound of one head banging."


Regards,
  Daryl Tester