[Zope] Puzzle

Steve Alexander steve@cat-box.net
Wed, 26 Apr 2000 22:50:09 +0100


Felipe Alvarez Harnecker wrote:
> 
> Hi Zopistas,
> 
> could you explain why this work
> 
>       <dtml-with "lib.widgets">
>          <dtml-call "REQUEST.set('sufijo','Arriendo')">
>          <dtml-var menuMoneda_dtml>
>       </dtml-with>
> 
> and this doesn't
> 
>       <dtml-with "lib.widgets">
>          <dtml-var "menuMoneda_dtml(sufijo='Arriendo')">
>       </dtml-with>
> 
> Cheers.

<dtml-var menuMoneda_dtml>

is equivalent to <dtml-var name="menuMoneda_dtml">

whilst, <dtml-var "menuMoneda_dtml(sufijo='Arriendo')">
is equivalent to <dtml-var expr="menuMoneda_dtml(sufijo='Arriendo')">

The stuff between the quotes in an expr attribute are essentially Python
expressions. The magic Zope does to pass in namespace and context just
doesn't happen in this case. Therefore, you need to add it yourself.


 This should do what you want:

  <dtml-var "menuMoneda_dtml(_.None, _, sufijo='Arriendo')">

There are quite a few messages on this in the list's archives. I don't
know how you'd go about searching for them, though :-)  Most searches
don't take "(_.None, _" as a valid search term.

--
Steve Alexander
Software Engineer
Cat-Box limited