'lo Tom

> you have a persistent object (inherits from persistent.Persistent) pobj
>
>>>> pobj.dict = {}
>>>> transaction.commit()
>>>> pobj.dict['foo'] = 'bar'
>>>> transaction.commit()
>>>> print pobj.dict
> {'foo': 'bar'}

The thing to note here is that {} is NOT a persistent object, and it
is the one being changed.

> Or use a persistence aware replacement.
>
>>>> from persistent.mapping import PersistentMapping
>>>> pobj.dict = PersistentMapping()

This replaces the {} with a subclass of PersistentMapping.

Now do you see what you're missing?

-- 
jean . .. .... //\\\oo///\\
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to