[Zope-dev] Re: Dealing with form data in External Methods

Martijn Pieters mj@antraciet.nl
Mon, 08 Nov 1999 10:20:22 +0100


I am moving this to Zope-Dev.

At 02:50 08/11/99 , David S. Harrison wrote:

>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.

Brian Lloyd's External Method HowTo provides all the answers:

   http://www.zope.org/Documentation/How-To/ExternalMethods



--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------