#34624: RelatedFieldWidgetWrapper links toggling isn’t working for radio widgets
-------------------------------------+-------------------------------------
Reporter: Thibaud | Owner: Coen van der Kamp
Colas |
Type: Bug | Status: assigned
Component: | Version: 4.2
contrib.admin |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
In the Redirects contrib module, when creating a new redirect, the first
field is for a Site instance. This is using a radio button (`radio_fields`
ModelAdmin definition:
https://github.com/django/django/blob/main/django/contrib/redirects/admin.py#L10).
This uses `RelatedFieldWidgetWrapper` – which doesn’t work for radio
widgets.
If we look at
[https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js#L223-L230
RelatedObjectLookups.js], it seems clear this code was only written to
support `select` widgets.
Tagging this `contrib.admin` because it seems to affect all usage of
`RelatedFieldWidgetWrapper` – but as far as I can see in Django itself
only `contrib.redirects` uses radio_fields.
---
In this instance I believe a `select` widget would be a much nicer
experience anyway, so not entirely sure whether it makes sense to change
the widget to fix this, or update the code to support radio buttons, or do
both.
--
Ticket URL: <https://code.djangoproject.com/ticket/34624>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701887bf0f183-7acfb892-e9a9-4216-8c63-bd41eda247c6-000000%40eu-central-1.amazonses.com.