[Zope] call DTMLMethod with parameter from Python

Damon Eckhoff eckhoffd@missouri.edu
Tue, 26 Mar 2002 11:54:49 -0600


I understand that...  Let me rephrase...
I have myZPT with a form.  The action of that form
is myPythonHandler.  I want to call myDTMLMethod from
within myPythonHandler to format data submitted by the
myZPT form into a string.

so from within myPythonHandler:
result_string = context.myDTMLMethod( ???requestVars??? )

Is this a reasonable thing to do?

I appreciate the help.

Kind Regards,

Damon.


> I can only give you a hint.
> In ZPT _ is here. Therefore you could try :
> <span tal:replace="structure python:here.myDTMLMethod( None, here,
> optionalkey1='yada' )"> ...
>
> Robert
>
>
>> I'm trying to clarify how to call a DTML Method with
>> parameters from a python script.  The docs I've read
>> say to call it something like this:
>>
>> result_string = context.myDTMLMethod( None, _, optionalkey1='yada' )
>>
>> But the python script I have is being called
>> from a Page Template as a result of a form action.  I
>> don't understand how to change this to work without the _ or how to
>> pass a REQUEST mapping to the DTMLMethod.
>>
>> Currently, when I make the call:
>>
>> result_string = context.formatResult()
>>
>> result_string actually contains the dtml code of formatResult 
>> (un-rendered)