[Zope] dtml-var syntax - am i being dumb ?

Richard Moon richard@dcs.co.uk
Wed, 23 Feb 2000 15:46:46 +0000


Please stop me going mad.

I created two python method. The first , called 'know_nothing' takes no 
parameters but returns the string "I know nothing",
the second, called 'timesit" takes two parameters, multiplies them and 
returns the result. When I come to use them from within
a DTML document why do I have to say
<dtml-var "timesit(1,2)">
but
<dtml-var know_nothing>

I assume the top one is short for
<dtml-var expr="timesit(1,2)">
whereas the second is short for
<dtml-var name=know_nothing> (or even <dtml-var name="know_nothing"> since 
that seems to work as well)

(am I right ?)

and I think I understand that the name attribute is actually a function 
call with no parameters - right  ?

but why does
<dtml-var expr="know_nothing" not return anything to the calling object ?

Just when you think you are getting the hang of it :-)


Richard Moon
richard@dcs.co.uk