[Zope] URL quoting in python

Chris McDonough chrism@digicool.com
Thu, 20 Jul 2000 11:54:04 -0400


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 Message-----
> From: Kapil Thangavelu [mailto:kvthan@wm.edu]
> Sent: Wednesday, July 19, 2000 11:46 PM
> To: zope@zope.org
> Subject: [Zope] URL quoting in python
> 
> 
> is there a way to get a url-encoded/quoted variable in 
> pythonish dtml ?
> 
> what i am trying to do
> <dtml-call "RESPONSE.redirect(URL1+'?foo_bar='+foobar)">
> 
> 
> Kapil
> 
> _______________________________________________
> 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 )
>