[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 13:19:52 -0500 (EST)


I found the problem with the returning of null values:

http://www.zope.org/Wikis/DevSite/Projects/ZPT/TutorialPart4


Getting at Zope Objects

The tradeoff is that path expressions don't allow you to specify those
details. For instance, if you have a form variable named "get", you must
write "python:request.form['get']", since "request/form/get" will evaluate
to the "get" method of the form dictionary.


Thanks again for your help!

--Daniel


On Mon, 24 Feb 2003, Daniel Tang wrote:

>
>
> Using the expression:
>
> <div tal:define=3D"results python:here.listProducts(type=3Drequest.form.c=
ar_type)"
>      tal:replace=3D"nothing">stuff</div>
>
>
>
> Gets me a TALESError in the python expression... the form is passing the
> value from an input text field.  Could that have any errors in it?
>
>
> --Daniel
>
>
>
> On Mon, 24 Feb 2003, [ISO-8859-15] Geir B=E6kholt wrote:
>
> > DT> Hello,
> >
> > DT> <div tal:define=3D"results python:here.listProducts(type=3D0)"
> > DT>      tal:replace=3D"nothing">stuff</div>
> >
> > DT> I've tried this:
> > DT> <div tal:define=3D"results python:here.listProducts(type=3D'string(=
${request.form.car_type})')"
> > DT>      tal:replace=3D"nothing">stuff</div>
> >
> >
> > check if this works:
> > tal:define=3D"results python:here.listProducts(type=3Drequest.form.car_=
type)
> >
> > :)
> >
> > --
> > Geir B=E6kholt
> >
> >
> > _______________________________________________
> > ZPT mailing list
> > ZPT@zope.org
> > http://mail.zope.org/mailman/listinfo/zpt
> >
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://mail.zope.org/mailman/listinfo/zpt
>