Re: [Zope] Values lost when restarting
On Tue, 2007-01-09 at 17:09 +0100, Andreas Jung wrote: --On 9. Januar 2007 17:06:24 +0100 Jonas Nielsen [EMAIL PROTECTED] wrote: The Zope Bible says something about calling self.__changed__(1) after updating the value but this doesn't seem to work even though the objects inherits from Persistent self._p_changed = 1 Well, I suppose that's the final nail in the coffin for the Zope Bible (like it actually *needed* another one at this point). I think the self.__changed__(1) spelling I used was deprecated even before I wrote the book, and I guess the supporting code must have been taken out of the ZODB since then. So, just shoot me and go pre-order Philipp's book now: http://www.amazon.com/exec/obidos/ASIN/3540338071/fiawol/ref=nosim Cheers all, - Michael R. Bernstein michaelbernstein.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Values lost when restarting
Hi this is probably a little vague but any help is appreciated. I'm developing on an old zope application, which I ported from zope 2.5.1 to zope 2.9. The application seems like it's based on the addressbook application in the Zope Bible The application is a tool for localization, where translators can log in and edit translation resources in resource folders I made a function to export all these resources to a csv-file and one to import the values in the zodb again. the text are set using a function on the resource calling def setText(self,language,text, REQUEST=None): # ... some stuff self.texts[language] = text The function works fine and updates the values correctly. But after I restart zope all the changes are lost. This not so when calling the function from the Resource objects web form. The Zope Bible says something about calling self.__changed__(1) after updating the value but this doesn't seem to work even though the objects inherits from Persistent When importing I fetch the object by using the RestrictedTraverse function, that's really the only difference I can see. Please write if you have ANY idea of what could be the problem. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Values lost when restarting
--On 9. Januar 2007 17:06:24 +0100 Jonas Nielsen [EMAIL PROTECTED] wrote: The Zope Bible says something about calling self.__changed__(1) after updating the value but this doesn't seem to work even though the objects inherits from Persistent self._p_changed = 1 -aj pgpc0BPV4vYce.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )