[ZODB-Dev] trigger loading a Persistent's attributes
Simon Burton
simon at arrowtheory.com
Sun Jan 28 14:11:57 EST 2007
On Sun, 28 Jan 2007 19:00:33 +0100
"Dieter Maurer" <dieter at handshake.de> wrote:
>
> Simon Burton wrote at 2007-1-27 15:18 -0800:
> >
> >I have a Persistent object, however, its attributes only
> >get loaded from the storage when I request a specific attribute.
> >Problem is, I don't know the names of the attributes
> >necessarily. I was trying to just query the __dict__ but
> >this does not trigger a load. Is there another way to do this ?
>
> Accessing (almost) any attribute (even a non existing one) will load
> the object. There are a few exceptions: attributes starting with "_p_"
> or "_v_".
>
Yes. I looked at the dir function, it seems that when it accesses the "__members__"
attribute this triggers a load.
This is ZODB-fu. So be it.
Simon.
More information about the ZODB-Dev
mailing list