[ZPT] passing a list to an url
John Petter Kvalvik
johnpk@hrp.no
Mon, 23 Dec 2002 09:16:54 +0100
Hi!
I have a form with a listbox with keywords. When submitting the form data,
the selected keywords are passed as a list. I have a python script that
handle the request before the result from a ZSQL method is presented in a
page template. I have used batching for the results. My problem is that when
the next batch is called, the list is converted to a string.
<a tal:condition="next"
tal:attributes="href
string:${request/URL0}/?start:int=${next/first}&Keywords=${request/Keywords}
&optGroupText=${request/optGroupText}
&optGroupField=${request/optGroupField}
&optGroupOrder=${request/optGroupOrder}"
href="next_url">next
</a>
A temporary solution to the problem is to handle this in the python script:
if same_type(Keywords,[])==0 and Keywords<>None:
Keywords=string.split(Keywords[1:-1],',')
tmp=[]
for x in Keywords:
tmp.append(string.strip(string.replace(x,"'","")))
Keywords=tmp
Is there a better way?
Petter