Script returning a zpt
If I call my ZPT with a URL ie show_orders?country=France it works a treat and the ZSql uses the country variable no probs How do I return this URL from a script? return context.show_orders(country='France') doesn't work! Am I miles off? Simon
You might've to set it in "REQUEST" object. So your script might look like: request = context.REQUEST request.set('country','France') return context.show_orders(request) Babu http://vsbabu.org/ Simon Faulkner wrote:
If I call my ZPT with a URL ie
show_orders?country=France it works a treat and the ZSql uses the country variable no probs
How do I return this URL from a script?
return context.show_orders(country='France') doesn't work!
Am I miles off?
Simon
Simon Faulkner wrote:
How do I return this URL from a script?
return context.show_orders(country='France') doesn't work!
In that instance, country will appear in the ZPT 'options' variable rather than the request. Code like this often works nicely: <tal:x replace="options/country|request/country"/> cheers, Chris
participants (3)
-
Chris Withers -
Satheesh Babu -
Simon Faulkner