[Zope] ID with Space in Name
Michel Pelletier
michel@digicool.com
Mon, 28 Feb 2000 15:48:09 -0800
Itamar Shtull-Trauring wrote:
>
>
> If you replace the url() function in the CatalogAware class with this
> version it should work,
> but it may break your applications and I'm not sure if this is the correct
> way to fix the problem.
>
> def url(self, ftype=urllib.splittype, fhost=urllib.splithost):
> """Return a SCRIPT_NAME-based url for an object."""
> from urllib import unquote
> if hasattr(self, 'DestinationURL') and \
> callable(self.DestinationURL):
> url='%s/%s' % (self.DestinationURL(), self.id)
> else: url=self.absolute_url(relative=1)
> type, uri=ftype(url)
> host, uri=fhost(uri)
> script_name=self.REQUEST['SCRIPT_NAME']
> __traceback_info__=(`uri`, `script_name`)
> if script_name:
> uri=filter(None, string.split(uri, script_name))[0]
> if uri[0] != '/': uri = '/' + uri
> uri=uri or '/'
> return unquote(uri)
I just checked in this fix, thanks.
-Michel