[Zope] Default arguments?
John Goerzen
jgoerzen@complete.org
Sun, 5 Sep 1999 23:08:39 -0500
Hi,
I have a method that is called as part of the branches_expr of a tree
tag. (Thanks for the pointer to dtml-return, BTW!)
I have a problem. I have some parameters to this method that I want
to be optional. I was testing for them with dtml-if, and then calling
REQUEST.set to set them to an appropriate value if they were not passed
in to this DTML method.
This seemed to work. However, when this was called from within the
tree tag, for some reason, it complains that REQUEST is not set. I have
tried every way I can think of to pass in both REQUEST and _, to no avail.
My only other way that I know to set these things is with dtml-with,
but since this is only called in some cases, there is a scoping problem;
the closing tag would have to occur after the /dtml-if. So, this is out.
I guess I have several questions:
* What's the solution to this particular problem?
* What's the preferred way to create or set variables in DTML?
* Why does REQUEST sometimes disappear?
I understand the search logic just fine (this is nicely explained in
the DTML book). But, it seems to be ignored; why is REQUEST no longer
present, and what can be done to remedy it?
Thanks,
John Goerzen