[Zope] Dealing with form data in External Methods

David S. Harrison dsh@magma-da.com
Sun, 07 Nov 1999 17:50:15 -0800


After a little experimentation, I found that the values submitted
via a form are placed into the receiving DTML document's name space.
That is very nice.  Now I am wondering whether these values are
also available to external methods I call as part of the evaluation
of the receiving DTML page.  Let me be more specific: suppose
I have an external method:

def ComputeColumns(self):
    # Find the value of 'testcase' in the enclosing name space?
    return computeList(testcase)

The DTML page that calls this external method has a form
variable named 'testcase'.  Is there some way I can use
the self object to evaluate names in the enclosing name space?
Or should I try to call the method explicitly with arguments?
Right now, the code in the DTML page is kind of nice:

<dtml-in ComputeColumns>
  <LI><dtml-var sequence-item>
</dtml-in>

I suppose I could change it to be a call.  But I am not
clear on what should be used for the name of "ComputeColumns"
or how it should be called.  My first guess would be:

<dtml-in "self.ComputeColumns(testcase)">

But I haven't tried it yet.  I am hoping there is some
method I can call using 'self' to evaluate name space
variables in an external method.

				David S. Harrison
				(dsh@magma-da.com)