Hi. I'm trying to html quote a zope object's ID, so that I can have spaces within it without erroring out. Clearly Zope's code handles this, as you can create objects with spaces in their IDs etc... Where does this get done? A glance at OFS/Folder.py yields no constructor (only class initializer). Where does that take place in zope's inheritance hierarchy? Failing all of that, are there any python standard library functions that can handle this, or anything in zope? cgi.escape (which is called by the html_quote in the DocumentTemplate module) doesn't do this completely... Many thanks. -- Alex
Alexander Westholm writes:
Hi. I'm trying to html quote a zope object's ID, so that I can have spaces within it without erroring out.... "html" quote does not do anything with spaces, only with "<", ">", "&" and '"'.
You might want "url_quote" (spaces inside URLs outside of query strings) or "url_quote_plus" (inside of query strings). These two functions are available via "dtml-var" attributes (of the same name) or from the module "Products.PythonScripts.standard" (in Python Scripts or ZPTs). Dieter
participants (2)
-
Alexander Westholm -
Dieter Maurer