[Zope] URL and list

Phil Harris phil.harris@zope.co.uk
Tue, 19 Jun 2001 17:11:11 +0100


Petr,

What about

<dtml-call "REQUEST.set('l',['foo', 'bla'])">
<dtml-call "REQUEST.set('new_bit','')">
<dtml-in l>
    <dtml-call "REQUEST.set('new_bit',new_bit + 'ids:list=%s'  %
_['sequence_item'])">
</dtml-in>
  <dtml-call "RESPONSE.redirect(new_url+new_bit))">

Probably easier to do in a python script tho ;)

Try variations on this, you have to bear in mind that zope will marshall
anything with :list type specifier into a Python list.

i.e. an url like http://localhost:8080?ids:list=1&ids:list=2&ids:list=3

will create a list called ids with these contents ['1','2','3'], note that
they are strings, I think you can modify the :list it to be :list:int but
I've never tried it myself.

----- Original Message -----
From: "Petr Knapek" <petr.knapek@nextra.cz>
To: "Andreas Jung" <andreas@andreas-jung.com>
Cc: "Petr Knapek" <petr.knapek@nextra.cz>; "zope-list" <zope@zope.org>
Sent: Tuesday, June 19, 2001 4:54 PM
Subject: Re: [Zope] URL and list


> >>>>> On Tue, 19 Jun 2001 10:59:55 -0400, "Andreas Jung"
<andreas@andreas-jung.com> said:
>
>     AJ> What about <dtml-let l="['foo', 'bla']"> <dtml-call
>     AJ> "RESPONSE.redirect(new_url+_.string.join(l,','))"> </dtml-let>
>
> No, this does't work.  I can see it in REQUEST as:
>
> l       'foo,bla'
>
> and I need it as ['foo', 'bla']
>
>     AJ> ?
>
>     AJ> Andreas
>
>
>     AJ> ----- Original Message ----- From: "Petr Knapek"
>     AJ> <petr.knapek@nextra.cz> To: <zope@zope.org> Sent: Tuesday, June
>     AJ> 19, 2001 10:44 AM Subject: [Zope] URL and list
>
>
>     AJ> Hi Zopists,
>
>     AJ>   I need to put a list attribute into URL and doesn't know the
>     AJ> correct syntax.  When I tried it, was represented as string in
>     AJ> REQUEST.
>
>
>     AJ> Here is my code:
>
>     AJ> <dtml-let l="['foo', 'bla']"> <dtml-call
>     AJ> "RESPONSE.redirect(new_url+`l`)"> </dtml-let>
>
>     AJ> where new_url is defined above something like this:
>     AJ> 'https://any.url/method_name?ids='
>
>     AJ> Thank you for help, Petr
>
> Petr
>
>
> _______________________________________________
> 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 )