[Zope] urlencode in ZPT - newbie question

Dominic Hiles Dominic.Hiles@bristol.ac.uk
Fri, 30 May 2003 16:00:20 +0100


Hi,

I have a ZPT which iterates through folders and files to produce a 
directory listing.  However, the links to these files need to be 
urlencoded, in case the file names contain spaces (or other "odd" 
characters).  I have tried the code given below, but urlencode isn't 
recognised ("NameError: global name 'urlencode' is not defined" :

<--- snip --->
<a href="id" tal:attributes="href python:urlencode(item.getId())">
<!--- snip --->

Any help would be much appreciated,

Thanks,

Dominic