[Zope-dev] dynamic setting of attributes

Robert Sander zope-dev@beteigeuze.cs.tu-berlin.de
Thu, 2 Mar 2000 17:04:38 +0100


On Sat, Feb 19, 2000 at 01:50:55PM +0100, Robert Sander wrote:

> 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.

Nobody has any thoughts on this? I think this topic is very interesting for 
all of you.

Greetings
-- 
Robert Sander                                 www.gurubert.de