Skip to content

Add DataGridFieldManager to fix UID reference validation in DataGrid fields#91

Open
Tim-IA wants to merge 4 commits into
senaite:2.xfrom
Tim-IA:handle-datagrid-fields
Open

Add DataGridFieldManager to fix UID reference validation in DataGrid fields#91
Tim-IA wants to merge 4 commits into
senaite:2.xfrom
Tim-IA:handle-datagrid-fields

Conversation

@Tim-IA

@Tim-IA Tim-IA commented Jul 13, 2026

Copy link
Copy Markdown

Description of the issue/feature this PR addresses

ZopeSchemaFieldManager has no dedicated handling for DataGridField. When a grid row contains a UIDReferenceField, creating objects via the JSON API fails with WrongContainedType, since JSON always delivers unicode (not str) and grid-nested UID fields always expect a list, even when multi_valued=False.

Current behavior before PR

WrongContainedType([WrongContainedType([WrongType(u'<uid>', <type 'str'>, '')], 'uid')], 'activities')

Desired behavior after PR is merged

New DataGridFieldManager(ZopeSchemaFieldManager) normalizes UID sub-fields in each row (coerces to list of native str) before delegating to the existing _set().

--
I confirm I have tested the PR thoroughly and coded it according to PEP8
standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant