Just for the record I think I've figured this one out.
Non-primitive persistent types need to initialised from the __init__
method, not just just declared at the class level like you would do
for a primitive type. ie:
class SrbTool(persistent.Persistent):
interface.implements(ISRBTool)
servers = None
something_primitive = 0
def __init__(self, *args, **kwargs):
super(persistent.Persistent, self).__init__(*args, **kwargs)
self.servers = persistent.dict.PersistentDict()
More info https://eresearch.jcu.edu.au/wiki/wiki/PloneSettingsUtilities
Nigel
2008/10/29 Nigel Sim <[EMAIL PROTECTED]>:
> I am using a locally registered utility for storing site-wide settings
> for my product, a la
> http://plone.org/documentation/how-to/adding-configuration-settings-using-zope-3-schemas-and-formlib
> .
>
> This seems to work ok for the really simple settings which are just
> strings. However I have an admin editable list of remote servers,
> represented as dicts. These do not get persisted.
>
> After reading about the Zope persistence I tried
> persistent.list.PersistentList() but the lists still end up empty
> after a restart.
>
> Is there a way to get these local utilities to persist the list, or am
> I going to have to create a tool-style folder and populate it with
> proper zope/plone objects?
>
> Cheers
> Nigel
>
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers