[Zope3-Users] Vocabulary with objects and persistence problem
Nylan
Nylan at gmx.net
Thu Apr 16 11:43:12 EDT 2009
Solved!
Thanks to Thierry Florac for pointing in the right direction:
Thierry Florac wrote:
Well, not absolutely sure but the problem may come that "source"
attribute is automatically defined as a 'simple' list (see introspector
to be sure), and not as a persistent one ; as a list is a mutable
object, changing one of it's attributes or adding/removing an item
doesn't flag the list as modified "from the persistent object point of
view", so it isn't stored into the ZODB when the transaction is
committed.
So you may have two solutions to handle this in the "removeSource"
method :
1. sources = self.source
sources.remove(source)
self.source = sources
2. self.source.remove(source)
self._p_changed = True
More information about the Zope3-users
mailing list