[Zope-dev] Persistence and __getattr__

Kent Polk kent@goathill.org
2 Jun 1999 20:42:51 GMT


It appears to me that if you have a class object that you want to
be Persistence, all the object attributes have to be in object.__dict__
or Persistence.__getattr__ has no way of retrieving them.

This at first seems pretty obvious, but what about instances where
your object attributes change outside of zope? I can't determine
any way to trigger an 'attribute refresh' on a __getattr__ failure
if the attribute does not exist in the object.__dict__.

Is this correct? Is it that 'volatile' attributes cannot be Persistent?

I see that when I try to override Persistence.__getattr__ in order
to add the capability to create or change attributes while still
seemingly duplicating the the method instructions, I encounter an
infinite loop. :^)  Yes, I read the docs, but I'm trying to figure
out if there is perhaps a way around this puzzle.

Thanks
Kent