[Zope] Handling object changes

Santi Camps santi at zetadb.com
Fri Jun 4 13:22:14 EDT 2004


En/na Andreas Jung ha escrit:

>
>
> --On Freitag, 4. Juni 2004 16:19 Uhr +0000 Santi Camps 
> <santi at zetadb.com> wrote:
>
>> Hi all,
>>
>> I'm looking for some method to handle changes on my objects.   I'm
>> interested in persistence changes.   I know I should be able to handle
>> some changes writting a __setattr__ method, but I'm also interested into
>> handle changes even if they are done in a list attribute, or in a
>> dictionary attribute.   That's it, I would be able to handle any changed
>> market in the "self._p_changed = 1" way, but I'm not able to find the
>> piece of code doing this work.
>>
>
> This stuff is documented in the Zope Developers Guide and the two ZODB
> for programmers articles somewhere in the docs section on zope.org.
>
> -aj
>
Sorry, I think I've not explained very well.

What I want to do is not know how I should use persistence, but how I 
can detect that something persistent has changed  on my object.  The 
purpose of this is write a base class able to handle any change of its 
descendants and put some code there.  Just like a trigger in a RDBMS.

I think that have a trigger-like functionallity will be very useful in 
some cases, you dont ?

Finally, I've found that this stuff is in cPersistence.[ch], writted in 
C.    I will try some thinks.

Thanks

Santi Camps






More information about the Zope mailing list