[Product-Developers] collective.z3cform.datagridfield + plone.app.relation.RelationList

Roel Bruggink roel at fourdigits.nl
Tue Dec 13 09:38:02 UTC 2011


The converter doesn't seem to get called. If I create some tests, could you
take a stab at the implementation?


On Sat, Dec 10, 2011 at 1:27 AM, Asko Soukka <asko.soukka at iki.fi> wrote:

> Hi,
>
> Roel Bruggink wrote:
>
>> On Thu, Dec 1, 2011 at 5:58 PM, David Glick <davidglick at groundwire.org
>> <mailto:davidglick at groundwire.**org <davidglick at groundwire.org>>> wrote:
>>
>>    On 12/1/11 8:44 AM, Roel Bruggink wrote:
>>
>>        I'm using a datagridfield in which I have a schema with a
>>        RelationList [1].
>>        When this form is saved the referenced objects are stored
>>        instead of a RelationValue.
>>
>>        Does anyone have an idea on how to fix this?
>>
>>        [1] http://pastie.org/2950299
>>
>>    Maybe related to
>>    http://code.google.com/p/__**dexterity/issues/detail?id=180<http://code.google.com/p/__dexterity/issues/detail?id=180>
>>    <http://code.google.com/p/**dexterity/issues/detail?id=180<http://code.google.com/p/dexterity/issues/detail?id=180>
>> **> ?
>>
>
> Actually, it is not, because my patch concerns only about storing
> RelationLists on dictionaries (RelationChoices already have their data
> manager). And yes, I should do tests for it before merge.
>
> Instead, I think this needs adding working query-method for
> RelationDictDataManager (see also https://dev.plone.org/ticket/**12031<https://dev.plone.org/ticket/12031>,
> I'm sorry for terrible language there).
>
>
>  It's the same sort of thing, but datagridfield doesn't actually uses a
>> datamanger to store the values, right?
>>
>
> I think it should use. I made branches that should store relation values
> with your example schema:
>
> collective.z3cform.**datagridfield = git git at github.com:datakurre/**
> collective.z3cform.**datagridfield.git branch=relationchoice-**integration
>
> plone.app.relationfield = git git at github.com:datakurre/**plone.app.relationfield.git
> branch=datagridfield-**integration
>
> I modified GridDataConverter to use data managers (did pass the existing
> tests, but may have side effects) and added query-method for
> RelationDictDataManager (needs tests).
>
> Yet, while editing the content on browser, I have to manually click one
> extra row to get the 'counter' incremented and my data saved (the widget
> starts with only one visible row).
>
> I'm also confused by this hack, I needed for data manager's 'query'-method
> to get z3c.formwidget.query return selected values correctly:
>
> https://github.com/datakurre/**plone.app.relationfield/**commit/**
> 2f0ce3c40f0cf523eeac7adfd7a78b**8db1890a68#L0R83<https://github.com/datakurre/plone.app.relationfield/commit/2f0ce3c40f0cf523eeac7adfd7a78b8db1890a68#L0R83>
>
> -Asko
>



-- 
Roel Bruggink
http://www.fourdigits.nl/mensen/roel-bruggink

Four Digits BV
http://www.fourdigits.nl
Willemsplein 44, 6811 KD, Arnhem
tel: +31(0)26 4422700 fax: +31(0)26 7600012
KVK 091621370000 BTW 8161.22.234.B01
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20111213/2360bca6/attachment.html>


More information about the Product-Developers mailing list