[Zope3-Users] What attributes are made persistent

Gary Poster gary at zope.com
Tue Feb 14 16:58:13 EST 2006


On Feb 14, 2006, at 4:52 PM, Florian Lindner wrote:

> Hello,
> in a class derived from Persistent, which attributes are stored?  
> All or only
> those thar are declared in the interface?

All.

>     def __init__(self):
>         self.queue = {}
>
>
> self.queue seem is empty each time I restart Zope.

Mutable objects, such as sets, lists, and dicts, can't inform their  
persistent parents when they change, so changes to them are not  
persisted.  Use a persistent mapping in the persistent package (or a  
btree); or set obj._p_changed=True when the dict changes; or use an  
immutable data structure that must be replaced on the object instead.

Gary


More information about the Zope3-users mailing list