PythonScript calling a DTML method and passing a list
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
From: "Ronald L. Roeber" <rroeber1@unl.edu>
print context.printResults( MyList, context, context.REQUEST ) return printed
'context' and 'REQUEST' should be the only positional parameters; anything else has to be keyword-style. Unless you're printing more than just the results of this one call, you can just return it: return context.printResults(context, context.REQUEST, MyList=MyList) Cheers, Evan @ digicool & 4-am
participants (2)
-
Evan Simpson -
Ronald L. Roeber