[Zope] External Methods

Dieter Maurer dieter@handshake.de
Wed, 22 Nov 2000 21:43:15 +0100 (CET)


Kini Natekar writes:
 >    I have got a html form which accepts an input from
 > the user. This input has to be passed to a Python
 > script, as a parameter, which is added as an external
 > method in zope. 
 >    Is there any way to do this ?
Your method:

def my_method(REQUEST):
  '''my_method interpreting *REQUEST*.form.'''
  form= REQUEST.form # this is a dictionary containing form
                     # variables and associated values
  .....


If you like, you can directly use it as form action.
But probably, you will wrap it into a DTML method:

DTML wrapper:

  .....
  <dtml-call "my_method(REQUEST)">
  .....


Dieter