[Zope] Returning generated gif via __getattr__

maxm maxm@mxm.dk
Mon, 25 Nov 2002 20:46:47 +0100


I have a gif image that I would like to return via a __getattr__ method.

But I have no clues as to how I can do it.

img_data # binary image data

# The problem below is that it needs a docstring to get published.

def __getattr__(self, attr):
     if attr = 'gif_image':
         return img_data

# and if I write:

def gif_image(self):
     "docstring"
     return img_data

The browser does not recognise the mime type.

Does anybody else have a clue as to what I need to do?

regards Max M