_p_changed, was RE: [ZODB-Dev] Excellent overview of ODBMS and my take on ZODB

Magnus Lyckå magnus@thinkware.se
Tue, 26 Feb 2002 23:54:04 +0100


Hm... Of course I once read this about __setattr__ and friends,
but I forgot...

At 14:00 2002-02-26 +0100, Geert-Jan Van Den Bogaerde wrote:
>"Recent versions of ZODB allow writing persistent classes that have
>__getattr__, __delattr__, or __setattr__ methods. The one minor
>complication is that the machinery for automatically detecting changes to
>the object is disabled while the __getattr__, __delattr__, or __setattr__
>method is executing. This means that if the object is modified, the object
>should be marked as dirty by setting the object's _p_changed method to
>true."

So what does this mean concretely. I don't modify
objects in __getattr__, and I don't override
__delattr__. Is it as simple as putting

self._p_changed = 1

in __setattr__ ? (I realize that I don't need to set it if
the object isn't actually changed in __setattr__.)

Is this all I need to think about? (Well, on this issue I
mean.)


-- 
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se