[Grok-dev] schema.List returns a list, but is it persistent?
sebastian at urbantalk.se
Fri Aug 28 04:29:55 EDT 2009
Fair enough, this needs to be opt out or opt in. But it needs to be
As it works now there is a very real chance of data loss that hasn't
been mentioned anywhere in the documentation. And being a framework
that provides "sensible defaults" I think it is a bad idea to require
setting _p_changed = True in these cases. The chance of missing that
is huge and data loss is by far the worst thing that can happen. Even
worse if it is subtle and infrequent.
On 27 aug 2009, at 13.13, Martin Aspeli wrote:
> Sebastian Ware wrote:
>> That is true, however I would definitely call that behaviour a bug in
>> schema.List. The assumption that only data manipulation is done with
>> applyData sounds risky. You could get some pretty creepy bugs...
>> Anyway, I'll look into your suggestion.
>> A suggestion is to change the behaviour of applyData so that it
>> returns PersistentList.
> The implications for backwards compatibility are enormous.
> Using a standard list is fine. It just means that if you modify the
> you need to do _p_changed = True on the parent object, or re-set the
> whole list.
> Author of `Professional Plone Development`, a book for developers who
> want to work with Plone. See http://martinaspeli.net/plone-book
> Grok-dev mailing list
> Grok-dev at zope.org
More information about the Grok-dev