Access and work with dynamic key and var in a python product ?
Hello again, How can i set variabels in a ZPT and send it over a link to a method from a Python Product. The method should generate a dynamic result page. The PROBLEM is, the variabels are dynamic an the method should can collect the key and variabels. I have no access to the REQUEST in the method. example: <span tal:define="global key1 python:request.set('key1','value1'"></span> <a href="result.zpt">link</a> or: <a href tal:attributes="result.zpt?key1=${key1}">link</a> in both way I can't access the key's and var's over the REQUEST.items() or REQUEST.form.items() (of corse i have no form). How can I do that. Remind: The key's and values's are dynamic generated !!! Otherwise ist not a problem. Thanks for a tip Mit freundlichen GrĂ¼ssen Roger Ineichen ___________________________ Projekt01 GmbH www.projekt01.ch Langackerstrasse 8 6330 Cham phone +41 (0)41 781 01 78 mobile +41 (0)79 340 52 32 fax +41 (0)41 781 00 78 email r.ineichen@projekt01.ch ___________________________ END OF MESSAGE
Roger writes:
Hello again, How can i set variabels in a ZPT and send it over a link to a method from a Python Product. The method should generate a dynamic result page. The PROBLEM is, the variabels are dynamic an the method should can collect the key and variabels. I have no access to the REQUEST in the method. You do have: "self.REQUEST", although it may be the wrong request object...
... <a href tal:attributes="result.zpt?key1=${key1}">link</a> This should work!
in both way I can't access the key's and var's over the REQUEST.items() or REQUEST.form.items() (of corse i have no form). You should use "REQUEST.form.items()" because it is much more efficient. Zope will put all request variables into "REQUEST.form", even when they are not originating from a form.
Why does your link use "result.zpt"? Didn't you say that the target should be a product method? Dieter
participants (2)
-
Dieter Maurer -
Roger