[Zope-dev] automatic sending of the 'REQUEST' argument
Brian Takashi Hooper
brian@garage.co.jp
Fri, 18 Feb 2000 11:25:12 +0900
Here's a question for any Document Template experts out there:
What is the mechanism which determines whether REQUEST is sent to
a function evaluated using dtml-var?
Recently I have been skulking around the management screen templates,
and I noticed that somehow it is possible to write something like:
(in manage_tabs.dtml)
<dtml-var "HelpSys.button(HelpSys,
product=option['help'][0],
topic=option['help'][1])">
Here the 'button.dtml' HTMLFile object is being called with 'HelpSys'
(the Help System instance) as a client and two keyword arguments,
'product' and 'topic'. That seems pretty clear.
However, in helpURL, which is a subtemplate of the button template,
looks like:
<dtml-var SCRIPT_NAME>/Control_Panel/Products/<dtml-var product>/Help/<dtml-var
topic>
SCRIPT_NAME is part of the REQUEST namespace, as far as I can tell...
but how is the REQUEST being passed to helpURL?
I added some debugging output to App/special_dtml.py to visualize
HTMLFile as it's being called, and sure enough it is getting passed a
REQUEST.
What's going on here? When I do stuff similar to the above in an expr,
I always seem to have to explicitly pass along the namespace, a la:
<dtml-var "myMethod(REQUEST=_)">
Enlightenment Please!
--Brian