Exporting an URL with a file extension from a product
Hi All, I'm quite a novice with Zope, and I'm working on a product which exports a style sheet(which is computed, so it can't be a static file). If the URL (and the python function name) is 'stylesheet', it works fine in IE but the style sheet is not cached by Netscape. I believe that the URL in the LINK tag needs to have an extension of .css to be cached by Netscape, but I would be happy to hear otherwise. How can I export an URL named "stylesheet.css" from a python product? gregory
Gregory Popovitch writes:
How can I export an URL named "stylesheet.css" from a python product? Usually you use:
class XXXX: ..... name= DTMLFile(....) # or something similar If "name" is not a valid Python name, you can use: class XXXX: ...... # note the indentation! The class definition is complete! setattr(XXXX, name, DTMLFile(....)) In your case: setattr(XXXX, 'stylesheet.css', DTMLFile(....)) An alternative would be: class XXXX: ..... locals()[name] = DTMLFile(....) ..... Dieter
participants (2)
-
Dieter Maurer -
Gregory Popovitch