[Zope] Manually take in variables in Python method.

Daryl Tester dt@picknowl.com.au
Fri, 28 Apr 2000 07:40:58 +0930


I haven't seen a response to this, and it's a bit dated, but here goes ...

Peter Bengtsson wrote:

> What I do (having created an External Method) to use querystrings in my
> python code is this.
> 
> <dtml-var "the_python_Id(MyQuerystring1, MyQuerystring2)"> (the querystrings
> are for example name, email, age, ... and not MyQuerystring(n))
> 
> And my python code returns something based on these inputs.
> 
> What if I have very many inputs.

Just pass in REQUEST to your External Method.

eg (from memory):

DTML Method:
  <dtml-var "the_python_Id(REQUEST)">

External Method:
  def the_python_method(self, REQUEST):
    for key, val in REQUEST.form.items():
      pass
    # Or whatever.


Regards,
  Daryl Tester