[ZPT] Passing parameter to Python Script

Grant Thibdeau miket@davisvision.com
Thu, 18 Apr 2002 12:19:55 -0700


Thank you, these are both exactly what I was looking for!!! Sorry for the 
simple question, altho now I have a different one, where would I need to 
define the request in the zpt? I'm assuming I have to tell the template to 
look somewhere, and that defining request would be telling it where to 
look? I kinda thought that request was one of the special words which looks 
stuff up in the header?  doing it with request makes the most sense, but 
it's claiming that I need to define request somewhere, any thoughts?

Sorry for spamming the list with n00b questions, I've just gotten quite 
stuck on this and can't get around it.


Again, thank you very much!!




At 05:55 PM 4/18/2002 +0200, you wrote:
>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
>
>
>
>_______________________________________________
>ZPT mailing list
>ZPT@zope.org
>http://lists.zope.org/mailman/listinfo/zpt