[ZPT] How do I use form variable to pass as a parameter to a python script?

Daniel Tang daniel.tang@chronicle.com
Mon, 24 Feb 2003 11:58:48 -0500 (EST)


Hello,

I would like to use a form variable from the previous page to pass to a
python script.


Example:

<div tal:define="results python:here.listProducts(type=0)"
     tal:replace="nothing">stuff</div>

I want to call a python function with input from the form variable
car_type instead of the value 0 (from the previous page).

<form name="testname" action="nextpage" method="post">
<input type="text" name="car_type">
<input type="submit" name="submit" value="Go">
</form>


I've tried this:


<div tal:define="results python:here.listProducts(type='string(${request.form.car_type})')"
     tal:replace="nothing">stuff</div>




But that still returns a "None" null.



Print out:

<span tal:replace="structure string:You have chosen a ${results}.<BR><BR>">text</span>


This returns the null value None when I access it afterwards.  Any ideas?



--Daniel