[ZODB-Dev] Re: ZODB _v_ attributes are tricky
Casey Duncan
casey at zope.com
Fri Apr 2 12:25:34 EST 2004
On Fri, 2 Apr 2004 12:05:57 -0500
Paul Winkler <pw_lists at slinkp.com> wrote:
[..]
> What might usage of your descriptors look like?
> Similar to properties? e.g.:
>
>
> class Foo(Persistent):
>
> def _expensiveMethod(self):
> ...
> return data
>
> _auto_caching_attribute = TransactionalVolatile(_expensiveMethod)
>
> That looks pretty nice to me, but how would I trigger invalidation?
You might be able to do something like::
Foo._auto_caching_attribute.invalidate(self)
-Casey
More information about the ZODB-Dev
mailing list