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. :-)
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 )
On Fri, 28 Apr 2000, Nbk wrote:
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?
You have the option of hacking your Zope installation so you can do <dtml-call "RESPONSE.redirect(_.url_quote(blah))">, or using an external method.
Then go to the collector and request it be added, as there is no reason it shouldn't be available and I forgot to put it in there when I asked this question a while back (one of the Mikes was thinking of to put it in the Zope distrib if I remember correctly).