[Zope] Passing parameters into DTML methods

Albert Boulanger aboulanger@ldeo.columbia.edu
Mon, 28 Jun 1999 19:47:26 -0500


I have the following dtml code piece (using Zope 1.10.2):


<!--#call "updateValue(newval=100)"-->

updateValue is a dtml method which looks like:


<!--#if "hasProperty('lastValue')"-->
<!--#call "manage_changeProperties(lastValue=newval)"-->
<!--#else-->
<!--#call
"manage_addProperty('lastValue',newval,getPropertyType('default'))"-->
<!--#/if-->

When I view the dtml method, foo, with the call <!--#call
"updateValue(newval=100)"-->
I get the error below . Interestingly, if I change the method above to:

<!--#if "hasProperty('lastValue')"-->
<!--#call "manage_changeProperties(lastValue=100)"-->
<!--#else-->
<!--#call
"manage_addProperty('lastValue',100,getPropertyType('default'))"-->
<!--#/if-->

And call it as  <!--#call updateValue--> it works.... Is this the right
way to pass in a parameter to a dtml method?

Traceback (innermost last):
  File lib/python/ZPublisher/Publish.py, line 877, in publish_module
  File lib/python/ZPublisher/Publish.py, line 590, in publish
    (Info:
/SeisRes/SeisResSub/ST295/Exp-2-18-99/SeisMod/submission/variables/submithost/foo)

  File lib/python/OFS/DTMLMethod.py, line 155, in __call__
    (Object: foo)
  File lib/python/OFS/DTMLMethod.py, line 151, in __call__
    (Object: foo)
  File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__
    (Object: foo)
  File lib/python/DocumentTemplate/DT_Util.py, line 266, in eval
    (Object: updateValue(newval=100))
  File <string>, line 0, in ?
  File lib/python/OFS/DTMLMethod.py, line 147, in __call__
    (Object: updateValue)
  File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__
    (Object: updateValue)
  File lib/python/DocumentTemplate/DT_Util.py, line 266, in eval
    (Object: hasProperty('lastValue'))
  File <string>, line 0, in ?
NameError: (see above)


Regards,
Albert Boulanger
aboulanger@ldeo.columbia.edu