AW: [ZPT] Parameter to a python script?

Damir Bartakovic damir@stud.fbi.fh-darmstadt.de
Fri, 25 Jan 2002 18:32:47 +0100


Thanks Evan,

this was it.
Hmm, maybe you should add a little remark in the "Tutorial Part 4 --> using
scripts"
like "don't forget to set the parameter in the Parameters field"!
for all these who never used a python script with parameters before :)

Cheers,
Damir


-----Ursprungliche Nachricht-----
Von: Evan Simpson [mailto:evan@zope.com]
Gesendet: 25 January 2002 16:59
An: Damir Bartakovic
Cc: zpt@zope.org
Betreff: Re: [ZPT] Parameter to a python script?


Damir Bartakovic wrote:
 > Therefore I am calling
 > <span tal:replace="python: here.display_sex(result.pers_sex)"></span>
 >
 > Since I am not very common with python and scripts. In which way I can
 > access the variable within the script?

You need to declare the parameter by placing it in the "Parameters"
field of the Script.  In this case, you could set the parameters of your
"display_sex" Script to "sex", and use that name to refer to it in the
body of the Script.  Your call above should work fine once you have done
this.

Cheers,

Evan @ Zope