[Zope-dev] automatic sending of the 'REQUEST' argument

Brian Takashi Hooper brian@garage.co.jp
Fri, 18 Feb 2000 12:04:31 +0900


I'll respond to my own post here by saying I'm messed in the head.

I was looking at two different versions of manage_tabs.dtml, one from a
slightly newer checkout :-)

No mystery here...

--Brian

On Fri, 18 Feb 2000 11:25:12 +0900
Brian Takashi Hooper <brian@garage.co.jp> wrote:

> 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
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 
>