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

Sebastian Ware sebastian at urbantalk.se
Thu Aug 27 04:43:23 EDT 2009


On 26 aug 2009, at 23.14, Gary Poster wrote:

>
> On Aug 26, 2009, at 5:11 PM, Leonardo Rochael Almeida wrote:
>
>> IMHO, for form uses inside standard Grok, storing a list (or a
>> PersistentList) shouldn't be much trouble, since only a really badly
>> designed form would actually bother to contain so much data in a  
>> value
>> returned from a schema.List element as to make little difference
>> regarding performance.
>>
>> Personally I'd be +0 at leaving things as they are (and +1 for  
>> leaving
>> it as is at least for Grok 1.0), +0.5 for having grok replace it with
>> a PersistentList if the interface or the implementation is not all
>> that complicated and -1 for adding a dependency on zc.blist for this
>> use-case.
>
> Makes sense to me, FWIW.
>
> Gary
>

applyData converts schema.List results > PersistentList for 1.0 is a  
+1.5 for me :) My work around was

      self.context.tags = PersistentList(data.get('tags', []))
      del data['tags']
      self.applyData(self.context, **data)

so I don't think it is that hard.

Mvh Sebastian


More information about the Grok-dev mailing list