I often create an external method for this...
em:
def url_quote(s):
import urllib
return urllib.quote_plus(s, safe='')
Silly, but it works.
I think the alternative is to hack the DT_Util.py module in the
DocumentTemplate directory to expose urllib or a derived function.
Thanks for the tip Duncan,
I find it strange that this utility function is not in the _ namepace...
time to make a trip to the Tracker. It seems like a url-encoding
function should be directly accessible from zope.
Thanks
Kapil
Duncan Booth wrote:
I often create an external method for
Kapil Thangavelu wrote:
what i am trying to do
dtml-call "RESPONSE.redirect(URL1+'?foo_bar='+foobar)"
dtml-call "RESPONSE.redirect(URL1+'?foo_bar='+foobar)" url_quote
dtml-call "RESPONSE.redirect(URL1+'?foo_bar='+foobar)" url_quote_plus
dependent on whether you want spaces coded as + or %20
I often create an external method for this...
em:
def url_quote(s):
import urllib
return urllib.quote_plus(s, safe='')
Silly, but it works.
I think the alternative is to hack the DT_Util.py module in the
DocumentTemplate directory to expose urllib or a derived function.
-Original
How about doing the equivalent on html_quote in python?
Chris
Chris McDonough wrote:
I often create an external method for this...
em:
def url_quote(s):
import urllib
return urllib.quote_plus(s, safe='')
Silly, but it works.
I think the alternative is to hack the
[EMAIL PROTECTED] wrote:
dtml-call "RESPONSE.redirect(URL1+'?foo_bar='+foobar)" url_quote
dtml-call "RESPONSE.redirect(URL1+'?foo_bar='+foobar)" url_quote_plus
Sorry, brain defect on my part: didn't notice the -call :(
I see someone alerady posted what I should have said...
It also
Didn't happen for me (Zope 2.2b4). I got
Invalid attribute name, "url_quote", for tag dtml-call
"REQUEST.set('URL',
URL2+'?action=Add Material
Infoproduct_number='+product_number)" url_quote,
on line 195 of index_html
It also fails for dtml-return... It looks like url_quote is