[ZPT] Opening a PageTemplate from a Python Script

robert robert at redcor.ch
Tue Jul 15 07:29:24 EDT 2003


just call your template as if it were a method.
Example:
Template called calculateForm
<body tal:define="result options/result | nothing;">
	<form action="calculateSum">
		<input type="text" name="a" >
		<input type="text" name="b" >
		<input type="text" tal:attributes="value result">
	</form>
</body>
You can  see here how to get the value from the "options" namespace.

The script calculateSumsum :
it has two parameters a,b
sum=int(a)+int(b)
#call the template, 
# assign the parameter result the calculated sum
return calculateForm(result=sum)

Robert

Am Dienstag, 15. Juli 2003 02:23 schrieb Tom Nichols:
> I want to open Page Template page from a Python Script that sets
> starting values for input tags on the page. It seems like I need to make
> those values part of the page's request object and use tal:attributes
> statements in the input tags on the page to set value attributes.  I
> don't know how to call the page from my Python Script and set values
> that will be available in the request on the page.  I would appreciate
> help with that and would especially appreciate any examples.
>
>
>
> If this request should be posted to a different list, I would appreciate
> the suggestion of an appropriate list.
>
>
>
> Thanks,
>
>
>
> Tom

-- 
mit freundlichen Grüssen

Robert Rottermann
www.redCOR.ch




More information about the ZPT mailing list