[Zope] Method with Dot in the name

Dieter Maurer dieter@handshake.de
Sat, 23 Nov 2002 21:07:32 +0100


Thomas Guettler writes:
 > Up to now I server some files in my Python Product with
 > a URL like .../download?file=foo.doc.
 > 
 > It would be much better if the URL would be .../foo.doc
 > 
 > Does someone know how this could be done?
 > 
 > The files are from the filesystem of the server. They are not in the
 > ZODB.
You give your product a "__getitem__(self,key)" method.
It is called by ZPublisher when an attribute lookup failed,
"key" will be the next URL segment, "foo.doc" in your example.


Dieter