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

Matt Goodall mgg@isotek.co.uk
Wed, 23 Feb 2000 17:21:06 +0000


Richard Moon wrote:
> 
> 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 :-)

I *think* that

	<dtml-var know_nothing>

is actually equivalent to

	<dtml-var expr="know_nothing()">

however I can't test this at the moment so I may be completely wrong
:-).

/Matt