#27487: ModelAdmin.formfield_overrides on ManyToManyField isn't compatible with
CheckboxSelectMultiple
-------------------------------------+-------------------------------------
Reporter: nrogers64 | Owner: Adonys
Type: | Alea Boffill
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Adonys Alea Boffill):
To fix this ticket, i've opted for a similar solution to the formset
behavior.
For the case of ChoiceFieldRenderer used on CheckboxSelectMultiple and
RadioSelect widgets, an empty item will be added as first item of the
list. This item could be used as a template for create a new element of
the list(<ul></ul>). Respecting all the html customizations made by the
developer.
The RelatedObjectLookups.js file is changed in order to handle the result
given by the admin related object popup. I added some JavaScript's tests
to validate the implementation of `dismissAddRelatedObjectPopup` method
for all cases.
Similar to the formset, I added an style class `empty-choice` to keep
hidden the empty item choice.
--
Ticket URL: <https://code.djangoproject.com/ticket/27487#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.b2ae8f876b7388da53f9c04bb3505bc3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.