[Zope-dev] dynamic setting of attributes

Robert Sander zope-dev@beteigeuze.cs.tu-berlin.de
Sat, 19 Feb 2000 13:50:55 +0100


Hi, it's me again..

I am working on a product with integrated caching mechanism. My product 
stores files with a MIME type, filename and content in an object with an 
unique ID. I do not want to use the filename as object IDs, because it is not 
unique.

I have an index_html method that set the "Content-Type" header to the MIME 
type and returns the content, so that every browser should handle it correctly.
The only disadvantage of this method is the loosing of the filename. I thought 
I could easily setattr(self, filename, self.index_html) but this results in a 
"Cannot pickle object" error.

Any hints appreciated.

Greeting
-- 
Robert Sander                                 www.gurubert.de