Hi, I have an instance of an object of a product, which inherits Persistent. I made some : self.listdata[item] = newdata OK newdata is used ... until I made a "Refresh" product then newdata has disapearded replaced by "initdata". Does I have something to do after self.listdata[item] = newdata to get it written in zodb ? thanks, if somebody can help -- _/ _/ _/_/_/ _/_/ 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
On Tue, Nov 13, 2001 at 07:00:36PM +0100, Michel Vayssade wrote:
Hi,
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 home: http://www.slinkp.com music: http://www.reacharms.com calendars: http://www.calendargalaxy.com
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
participants (2)
-
Michel Vayssade -
Paul Winkler