[ZPT] Passing parameter to Python Script

Godefroid Chapelle gotcha@swing.be
Thu, 18 Apr 2002 17:55:31 +0200


At 20:42 18/04/2002, Grant Thibdeau wrote:
>Hello Folks, this is another simple question that I seem to be having 
>issues with, i'm attempting to get a value from my url, it's appended to 
>the end like --
>
>http://www.link.com/PageTemplate?rebate=100
>
>So that goes to my PageTemplate, which has several macros in it, one of 
>the macros calls a python script which does some stuff with the rebate 
>number in the url. How do I pass the value from the url to the script call 
>in the zpt? This is what my script call looks like --
>
>
>       <p tal:content="root/Lens123/Python/pyGetRebate"
>
>but whenever I try to add anything to the call, it starts looking for the 
>literal thing.  So I tried to do a python statement like so --
>
>        <p tal:content="python: container.pyGetRebate()"

if I get it, you need to tell

         <p tal:content="python: container.pyGetRebate(request.rebate)"

>which gives me a TALES error, a couple other iterations of it do not work 
>either, such as dropping the parentheses and rebate is a parameter on the 
>script, would I need other parameters? Any help or suggestions would be 
>greatly appreciated, or if this isn't the correct idea behind using this 
>please let me know.  In my script i'm trying to assign the rebate number 
>like so --
>
>argRebateNumber=form['rebate']
>
>Could I be trying to assign it incorrectly too?  Thanks!
>

and just have expressed rebate as a parameter of your python script.



>_______________________________________________
>ZPT mailing list
>ZPT@zope.org
>http://lists.zope.org/mailman/listinfo/zpt

--

Godefroid Chapelle

BubbleNet sprl
rue Victor Horta, 18 / 202
1348 Louvain-la-Neuve
Belgium

Tel + 32 (10) 459901
Mob + 32 (477) 363942

TVA 467 093 008
RC Niv 49849