-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate new UID reference widget #2295
Conversation
…senaite.core into new-uidreference-widget
…senaite.core into new-uidreference-widget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this astonishing work!. Plenty of things here. I've done functional testing and works as expected for reference fields and widgets from core.
@xispa , I've found a couple of fields/widgets of mine (e.g. UIDOtherReferenceField
and UIDOtherReferenceWidget
that require attention) before we can move custom add-ons forward with this change.
return filter(lambda uid: uid, value) | ||
if api.is_string(value): | ||
value = value.split("\r\n") | ||
return list(filter(None, value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do
return list(filter(api.is_uid, value))
|
||
# extract the assigned UIDs for multi-reference fields | ||
if field.multiValued: | ||
value = filter(None, value.split(",")) | ||
value = filter(None, fieldvalue.split("\r\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value = filter(api.is_uid, fieldvalue.split("\r\n"))
Description of the issue/feature this PR addresses
This PR integrates the new DX compatible UID reference widget for all AT reference fields
Current behavior before PR
Old widget is used for AT reference fields
Desired behavior after PR is merged
New widget is used for AT reference fields
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.