[Zope] - What constitutes a transaction?
Scott Robertson
sroberts@codeit.com
Sun, 13 Dec 1998 17:19:57 -0800 (PST)
On Sun, 13 Dec 1998, Ty Sarna wrote:
> I'm obviosuly missing something here.
>
> I have a product, a subclass of Folder. It has several methods that do
> things to its internal state. Some of these methods cause a transacton
> to be generated (Ie, when adding or deleting objects, setting
> properties, etc., the method shows up in Undo). When I shut down zope
> and restart it, these changes are still there. My added methods have
> effect that is forgotten at shutdown, and they don't show up in the Undo
> list. I have another Product where my added methods do work correctly.
>
> What am I missing?
>
It sounds like your using a mutable (Is this the right term?) like a list
or a dictionary to store your properties. You'll need to call the
__change__() method with a value of true to notify the storage routines
that this objects needs to be changed.
So for example do something like this.
class Spam:
def __init__(self)
self.eggs={}
def add(self,id, value)
self.eggs[id] = value
self.__changed__(1)
---------------------------------------------------
- Scott Robertson Phone: 714.972.2299 -
- CodeIt Computing Fax: 714.972.2399 -
- http://codeit.com -
---------------------------------------------------