[Zope] A nice problem with url_quote_plus

Chris Withers chrisw@nipltd.com
Fri, 28 Apr 2000 12:16:43 +0100


Would I be correct in assuming what you'd like to do is:

<dtml-call "RESPONSE.redirect(<dtml-var "_.string.join([url,query],'')"
url_quote_plus>)">

If the syntax were allowed? (which unfortunately, it doesn't :( )

There must be a simple way to do this, but I can't think of it :S

Sorry,

Chris

Nbk wrote:
> 
>   Hi.
> 
>   I have the folowing code in one of my DTML method's:
> 
>   <dtml-call "RESPONSE.redirect(_.string.join([url,query],''))">
> 
>   'url' and 'query' are two variables passed by the REQUEST. This work's just fine,
> but with some minor :-) problems in my case. If i have a 'query' with some spaces,
> the RESPONSE.redirect causes an obvious http error. So, i want to replace some
> characters of my 'query' variable. And guess what? <dtml-var url url_quote_plus>
> gives me the right string. How do i do an "quote_plus" ( like in python urllib module )
> in Zope, without using an External Method?
> 
>   BTW, i've used an python method, but with no luck ( i can't make a
> simple "import urllib").
> 
> TIA,
> 
> @886, Nbk ( Just believe, Zope source code is the best place to find up-to-date
> documentation! )
> 
> P.S. - I've looked up for the solution in www.google.com, www.egroups.com,
> lists.zope.org, www.zope.org, www.python.org, and some other resources.
> I had find some interesting ideas, but none of them are usefull to this problem. :-)
> 
> _______________________________________________
> 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 )