[Zope] persistance

Michel Vayssade michel.vayssade@utc.fr
Tue, 13 Nov 2001 21:57:42 +0100 (MET)


On Tue, 13 Nov 2001, Paul Winkler wrote:
> > I have an instance of an object of a product, which inherits
> > Persistent.
> > I made some : self.listdata[item] = newdata
> Which of the above inherit from Persistent?  If it's just the "self"
> object, that's not enough to tell ZODB that self.listdata has changed.
> You can either
> A) use a Persistent subclass for listdata, instead of a normal list.
>    Then it should be automatic.
> Or
> B) Explicitly tell Zope when you change things like this. Example:
>    def some_method(self, data, REQUEST=None):
>        self.listdata = data
>        self._p_changed = 1  # this updates the object in the ZODB  
> paul winkler

self._p_changed = 1  this was exactly what I was looking for
it works !

thank you very much

--
  _/   _/ _/_/_/  _/_/ Michel.Vayssade@UTC.fr    Service Informatique
 _/   _/   _/  _/      T:33/0-3.44.23.49.24 Universite de Technologie
_/   _/   _/  _/       F:33/0-3.44.23.46.77 BP 20.529 60205 Compiegne
 _/_/    _/    _/_/    _ mv@utc.fr __/www.utc.fr/~vayssade____ France