__parent__ - like attribute?
Andrew Bennetts
andrew-pythonlist at puzzling.org
Sun Jan 19 01:59:46 EST 2003
On Sat, Jan 18, 2003 at 08:28:44PM -0800, Dylan Reinhardt wrote:
> At 07:48 PM 1/18/2003, Andrew Bennetts wrote:
> >Why don't you simply make eggs inherit from Persistent, and let it set its
> >own _p_changed flag?
>
> A fair question. What the example obscures is that spam is, itself, a
> subobject of a object that uses Persistent. Or does that not matter?
If spam is also a subclass of Persistent, then it should all Just Work
(assuming you are setting _p_changed when necessary :)
> A related issue is that I also want the subobjects to obtain/acquire
> settings from their containing object. Seems the same trick to do one
> should do the other, but _p_changed won't do double duty here.
For this you probably want to use Acquisition.Explicit or
Acquistion.Implicit, but this is essentially unrelated to persistence.
-Andrew.
More information about the Python-list
mailing list