8 May
2001
8 May
'01
6:48 p.m.
Paul Winkler writes:
This is with Zope 2.2.2. If I give a default argument to the external method, and call it from a dtml method, the default gets used even if I pass the argument.
Example: Try creating two external methods and calling them like this from standard_html_footer.
<dtml-var "my_ext_method1(_['id'])"> <dtml-var "my_ext_method2(_['id'])">
Here are the two external method definitions:
def my_ext_method1(id): return "<br>%s" % id
def my_ext_method2(id="oops"): return "<br>%s" % id
Anybody else get this? Why does it do that? I know this only, if the first parameter is called "self".
We use default parameters regularly (in Zope 2.1.6) and they work as expected. Dieter