[Zope] persistance

Paul Winkler slinkp23@yahoo.com
Tue, 13 Nov 2001 13:20:02 -0500


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