[Zope] PythonScript calling a DTML method and passing a list

Ronald L. Roeber rroeber1@unl.edu
29 Mar 2001 15:55:53 -0600


Hello,

I am still unclear on how to call a DTML method with a script while
passing the results of that script. For example.

The results of some long form call a PythonScript called makeSummary
I want the results of makeSummary called MyList to be passed to a DTML
Method called printResults

---makeSummary PythonScript-----
REQUEST = context.REQUEST
RESPONSE = context.REQUEST.RESPONSE
""" Magic Python Code that generates a summary list"""

MyList=['one','two','three',...]      # Simuation

print context.printResults( MyList, context, context.REQUEST )
return printed
-----end of script------
--section of printResults DTML method---
   <dtml-in MyList>
      Score    Priority
      <dtml-var sequence-item>
    </dtml-in>
-----------

Zope returns a Key Error: and states that "This resource (printResults)
may be trying to reference a nonexistent object or variable MyList".

It seems MyList is either gone or not in the namespace of the
printResults DTML method. What am I doing wrong? I can't seem to find or
(more likely) don't understand how do this from the documentation.

Ronald L. Roeber
University of Nebraska