[Zope-dev] ComputedAttribute

Chris Withers chrisw@nipltd.com
Fri, 05 Jan 2001 12:22:32 +0000


Martijn Pieters wrote:
> 
> You could use ComputedAttribute for that:
> 
> class MyClass(Acquisition.Explicit):
>     # The following attribute is acquired transparently
>     def _acquired_your_attribute(self):
>         return self.aq_acquire('your_attribute')
>     your_attribute = 	ComputedAttribute(_acquired_your_attribute, 1)
> 
>     # index_html isn't
>     index_html = None

That looks cool :-)

Where's it documented? what does the 1 mean?

cheers,

Chris