[ZPT] nested access to object data
Andreas Jung
andreas at andreas-jung.com
Fri May 9 20:27:47 EDT 2003
--On Donnerstag, 8. Mai 2003 2:47 Uhr -0700 Jamie Heilman
<jamie at audible.transient.net> wrote:
> Andreas Jung wrote:
>> But I want "here/getFoo/key" :-)
>
> from ComputedAttribute import ComputedAttribute
>
> class X:
> _data1 = {}
> _data2 = {}
> def _getData1(self): return self._data1.copy()
> def _getData2(self): return self._data2.copy()
> data1 = ComputedAttribute(_getData1)
> data2 = ComputedAttribute(_getData2)
Works pretty fine for me !
Thanks,
Andreas
More information about the ZPT
mailing list