Hi Zopists, I need to put a list attribute into URL and doesn't know the correct syntax. When I tried it, was represented as string in REQUEST. Here is my code: <dtml-let l="['foo', 'bla']"> <dtml-call "RESPONSE.redirect(new_url+`l`)"> </dtml-let> where new_url is defined above something like this: 'https://any.url/method_name?ids=' Thank you for help, Petr -- Petr Knápek Network Development NEXTRA Czech Republic s.r.o. http://www.nextra.cz/ V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic Tel: +420/2/96 355 111 / Mobile: +420/604-202 611 E-Mail: petr.knapek@nextra.com Contact address: Hlinky 114 / CZ - 603 00 Brno / Czech Republic Tel: +420/5/43 554 150 / FAX: +420/5/43 554 214 see Disclaimer http://www.nextra.cz/disclaimer/
What about <dtml-let l="['foo', 'bla']"> <dtml-call "RESPONSE.redirect(new_url+_.string.join(l,','))"> </dtml-let> ? Andreas ----- Original Message ----- From: "Petr Knapek" <petr.knapek@nextra.cz> To: <zope@zope.org> Sent: Tuesday, June 19, 2001 10:44 AM Subject: [Zope] URL and list Hi Zopists, I need to put a list attribute into URL and doesn't know the correct syntax. When I tried it, was represented as string in REQUEST. Here is my code: <dtml-let l="['foo', 'bla']"> <dtml-call "RESPONSE.redirect(new_url+`l`)"> </dtml-let> where new_url is defined above something like this: 'https://any.url/method_name?ids=' Thank you for help, Petr -- Petr Knápek Network Development NEXTRA Czech Republic s.r.o. http://www.nextra.cz/ V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic Tel: +420/2/96 355 111 / Mobile: +420/604-202 611 E-Mail: petr.knapek@nextra.com Contact address: Hlinky 114 / CZ - 603 00 Brno / Czech Republic Tel: +420/5/43 554 150 / FAX: +420/5/43 554 214 see Disclaimer http://www.nextra.cz/disclaimer/ _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Petr Knapek writes:
I need to put a list attribute into URL and doesn't know the correct syntax. When I tried it, was represented as string in REQUEST.
Here is my code:
<dtml-let l="['foo', 'bla']"> <dtml-call "RESPONSE.redirect(new_url+`l`)"> </dtml-let>
where new_url is defined above something like this: 'https://any.url/method_name?ids=' You would create the following URL:
https://..................?ids:list=foo&ids:list=bla&ids:list=...... Note that your list values must be "url_quote_plus" encoded for this, if they contain special characters including white space! It is not easy to build such an URL in DTML (it is possible, though). Use a Python Script. There, you have "for" loops and assignment and can access the "url_quote_plus" encoder (--> mailing list archives). Dieter
participants (3)
-
Andreas Jung -
Dieter Maurer -
Petr Knapek