[Zope] Argument passing and DTMLFile methods

Terry Hancock hancock@anansispaceworks.com
Tue, 02 Jul 2002 06:28:40 -0700


Dieter Maurer wrote:
>   "DTMLFile" uses the modern "Bindings" infrastructure introduced
>   with Python Scripts and subsequently used by PageTemplates
>   and "DTMLFile".
> 
>   You can pass the DTML namespace in the following way:
> 
>       your_dtml_file_object(caller_namespace=_, more_keyword_parameters)

Ah-hah!

This works from within my DTMLFile method, like so:

<dtml-let key1="val1" key2="val2">
   <dtml-var expr="my_dtmlfile_method(_.None, _, caller_namespace=_,
key1=val1)">
</dtml-let>

Then it is possible to use *both* key1 and key2 in "my_dtmlfile_method".
(In practice, key1 probably needed to be passed something other than
the value it already had to justify this call).
(Zope 2.5.1).

Thanks Dieter!

This is definitely going in my product's developer 
documentation. ;-D

Cheers,
Terry

-- 
------------------------------------------------------
Terry Hancock
hancock@anansispaceworks.com       
Anansi Spaceworks                 
http://www.anansispaceworks.com 
P.O. Box 60583                     
Pasadena, CA 91116-6583
------------------------------------------------------