Re: [Zope3-Users] Disappearing dictionary. Upon restart, dictionary resets.

2005-09-26 Thread Tom Dossis
Alec Munro wrote: Well, I narrowed it down a little bit more. I've been initializing the dictionary in the class declaration, like the following: class SomeObj: some_dictionary = PersistentDict({}) Now, for some reason, each time Zope was started, it called this, and whenever I tried to

Re: [Zope3-Users] Disappearing dictionary. Upon restart, dictionary resets.

2005-09-26 Thread Chris Withers
Alec Munro wrote: class SomeObj: some_dictionary = PersistentDict({}) ouch, never use mutables for class attributes, for exactly the reasons you've found. two points: 1. the dict will get newly created every time this code runs, ie: each time Zope starts. 2. the object is never

Re: [Zope3-Users] Disappearing dictionary. Upon restart, dictionary resets.

2005-09-26 Thread Alec Munro
Woohoo! This is precisely the advice I needed. I think where I got tripped up is that I rarely use class attributes outside of Zope (setting everything up in __init__), so I actually stopped treating them as class attributes, and pretended they were simply part of the initilization. I think I'm

Re: [Zope3-Users] Disappearing dictionary. Upon restart, dictionary resets.

2005-09-25 Thread Alec Munro
Well, I narrowed it down a little bit more. I've been initializing the dictionary in the class declaration, like the following: class SomeObj: some_dictionary = PersistentDict({}) Now, for some reason, each time Zope was started, it called this, and whenever I tried to access the