[Zope-CMF] Class attribute NOT persisting ????

Jean-Francois.Doyon at CCRS.NRCan.gc.ca Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Tue Nov 4 17:02:37 EST 2003


Hello,

I have a fairly simple CMF Tool.  It is just a class with a few methods and
attributes.

Here the __init__:

        def __init__(self):
                self.maptypes = []
                self.supptopics = []
                self.badtopics = []
                self.topicreferences = {}

I then have this method:

        security.declareProtected( 'Modify MapList Settings',
'manage_references_edit' )
 
        def manage_references_edit(self, topicname, references):
                self.topicreferences[topicname] = references

Then of course more methods that actually make use of said attribute of
interest "topicreferences"

My problem: The "topicreferences" attribute does NOT persist in the ZODB !!
Every time I restart Zope, I loose the contents of that attribute! I checked
an XML export of the tool instance, and the topicreferences dictionary is
indeed there, but empty.

I'm really not familiar with the transactional features/nature of the ZODB
to go digging there ... Anybody know what's going on ? is this a bug ? I've
never encountered this problem before.  I haven't checked, but I'm also
pretty sure I've used dictionary attributes before without trouble.  I've of
course also tried removing/adding the tool a couple of times.

I'm using Zope 2.6.2 + CMF 1.4.2 + Python 2.2.3 on RH7.3 ...

Help! I think I'm going mad !

Thanks,

Jean-François Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410




More information about the Zope-CMF mailing list