On Thu, 2005-10-13 at 19:04 -0400, Tim Peters wrote:
> > from the connection object,
> You didn't say which version of ZODB you're using. Since you believe
> Connection keeps track of which objects have been modified, I'll
> you're using ZODB 3.3 or later (which is either true, or your belief
> who keeps track of modified objects is false ;-)).
yup i missed this info, i'm using zodb 3.4
> > so i overload the __setattr__ method in my base-class and keep track
> > of the modified objects
> > But that's the problem, __setattr__ is called also when ZODB loads
> > objects from the storage and reconstructs it, so is there a way to
> > the state of the object (unpickilng, modified, clean etc etc)?
> The good news is that obj._p_state reveals the current state of a
> object. The possible values are exposed by the `persistent` module:
I see, yesterday, after my message obviously, i see the light and write
[... some code ...]
def __setattr__(self, attr, value):
if not self._p_setattr(attr, value):
super(PersistentObject, self).__setattr__(attr, value)
if not attr.startswith('_p_') and self._p_changed and attr!
> So, in the end, I don't see any hope for you via this route, short of
> register an object as changed in your __setattr__ without worrying at
> about _why_ __setattr__ was called. Later, when you "do something"
> your list of modified objects, simply ignore any whose state at that
> UPTODATE. Those are exactly the objects whose state got materialized
> didn't change thereafter.
Ok, thank you for your help
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org