[Zope] Persistence of DataStructures in Collector class???
J Cameron Cooper
jccooper@jcameroncooper.com
Thu, 15 May 2003 18:31:39 -0500
> I am extending the Collector class in CMFCollector. I have added
> a dictionary data structure inside the Collector class. I am
> manipulating the dictionary whenever status of a bug changes. For this
> I have added some scripts inside the CMF_Collector_Work Flow and it
> works perfectly.
>
> I want this data structure to be persistent.. Whats the problem I
> have now is... the dictionary value gets lost whenever I restart zope.
>
> Is there any way to make it persistent without using database or
> ZODB.????
The persistence machinery can't notice changes to dictionary (or list)
attributes of persistent objects unless you notify it.
You can try
http://www.zope.org/Members/AndrewWilcox/PersistentListDict
or you can take the more "traditional" approach as in
http://www.zope.org/Documentation/Articles/ZODB1
(specifically the _p_changed attribute.)
Not coincidentally, these are the top two links under a Google search
for 'zope dictionary persistence'.
--jcc