Sounds like you are trying to persist a class attribute value. This is not
possible because instance are persistent, not classes. This is also the
reason that the values change over all the instances. You are changing a
mutable attribute of the class in place.
I would suggest setting the
From: Arndt Droullier [EMAIL PROTECTED]
How can I save the list/dictionaries after changes?
The easiest thing to do is to is to use PersistentMapping and
PersistentList.
Create them in __init__ with self.dictionary = PersistentMapping() instead
of setting them as a class attribute.
On Thu, 28 Jun 2001, Mark McEahern wrote:
I'm a Zope and Python newbie and I'm trying to utilize Persistence, but I've
seen two different ways:
import ZODB
from Persistence import Persistent
vs.
from Globals import Persistent
Are these different? If so, which is
Jon Franz [EMAIL PROTECTED] wrote
Ah! this makes more sense, the idea of persistent properties even
fits with this idea, though a true write-in-place property might be
even better for some applications ;)
Two things:
* Don't count on storing the hit counter as a separate, "persistence
Jon Franz wrote:
So subclassing persistent will avoid changes to the object being stored and
roll-backable in the ZODB?
NO! read the posting again... Subclassing from persistent is HOW you make things
live in the ZODB. However, objects that subclass Persistent get their own pickle
jar, and
:[EMAIL PROTECTED]]
Sent: Sunday, February 11, 2001 1:05 PM
To: Jon Franz
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] Persistence ( was Thread Safe Counting )
Jon Franz wrote:
So subclassing persistent will avoid changes to the object
being stored and
roll-backable in the ZODB