[Grok-dev] schema.List returns a list, but is it persistent?

Sebastian Ware 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  
there.

   self.applyData(forceZodbDataTypes=True)

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.

Mvh Sebastian

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.
>
> -1
>
> The implications for backwards compatibility are enormous.
>
> Using a standard list is fine. It just means that if you modify the  
> list
> you need to do _p_changed = True on the parent object, or re-set the
> whole list.
>
> Martin
>
> -- 
> 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
> http://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list