[Zope] what is wrong with this python code?

Dieter Maurer dieter at handshake.de
Sun Nov 9 03:05:03 EST 2003


Yurj wrote at 2003-11-7 18:44 -0100:
 > if query.find('&page=') != -1:
 > query = query[:query.find('&page=')]
 > 
 > (aim to strip out all after &page= in a query string)
 > 
 > it don't works if query (pass as parameter, it is HTTP_QUERY) has %3A
 > caracters *ex: when you have field:string in a web form*
 > 
 > why find gives error? :(

The "ZTUtils" package (in "lib/python") gives you much better
ways to construct queries.

Please look at "url_query", "make_query", "make_hidden_input"
in its "Zope.py" module.

-- 
Dieter



More information about the Zope mailing list