> 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.

Isn't an external method a bit overkill? It is possible to just create a 
DTML Method called url_quote where the body is:
<dtml-var s url_quote>

(making sure there is no whitespace before this line, and no 
newline after it.)

Then from any other DTML method you just call it remembering to 
pass in the parameter by name.


Duncan Booth                                             [EMAIL PROTECTED]
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to