[Zope] Returning generated gif via __getattr__

Thomas Guettler Thomas Guettler <thomas@thomas-guettler.de>
Mon, 25 Nov 2002 22:51:18 +0100


On Mon, Nov 25, 2002 at 08:46:47PM +0100, maxm wrote:
> 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
> 

See post "Method with dot in the name" some days ago:

write a second method:

def downlod(file, REQUEST):
....

and in __getitem__:

  self.REQUEST["file"]=key
  return self.download

 thomas

-- 
Thomas Guettler <guettli@thomas-guettler.de>
http://www.thomas-guettler.de