[Zope-dev] Persistence and __getattr__

Kent Polk kent@goathill.org
Wed, 2 Jun 1999 16:16:30 -0500 (CDT)


Jim Fulton wrote:
> Kent Polk wrote:
> > 
> > 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 is right, unless you are willing to go down to the C level.

> Why are these objects persistent?  If they are persistent, then 
> their data is stored in Zope and doesn't change outside of
> Zope.

> Yes.  It sounds like you don't want a persistent object at all.
> You want an object that get's it's data from somewhere else
> (somewhere other than the object database).

I was attempting to provide a convenient way to load and refresh
attributes into the Zope database and still make use of Persistent's
caching abilities, etc.

> You can have a sub-object of a persistent object that is not persistent
> and gets *it's* data from somewhere else.  This is essentially what
> happens with database connections and SQL methods. 

Yeah. Considered that, but I doesn't really gain me anything in this case,
as all the objects would have volatile attributes.

Thanks
Kent