ZODB: don't like self._p_changed
Jeremy Hylton
jeremy at alum.mit.edu
Thu Jan 9 12:06:41 EST 2003
Thomas Guettler <zopestoller at thomas-guettler.de> wrote in message news:<avjj10$oe7$03$1 at news.t-online.com>...
> Max M schrieb:
> > Thomas Guettler wrote:
> >
> >> Hi!
> >>
> >> I like ZODB very much. With it I don't need to
> >> squeeze my application into database tables.
> >>
> >> Unfortunately you need to set self._p_changed=1
> >> if you change a list of the object.
> >>
> >> Example:
> >> self.my_list.append("foo")
> >> self._p_changed=1 # This is needed
>
> [cut]
>
> >> Will this disappear in the future?
> >
> > Probably not. How should an object know if a mutable subobject has been
> > changed?
>
> The method "append" could set the flag.
What kind of object is my_list? If you use PersistentList, it will
set the flag. The _p_changed flag is only necessary when working with
mutable subobjects that are not themselves persistent objects.
Jeremy
More information about the Python-list
mailing list