Opened 21 months ago
Last modified 3 months ago
#34624 assigned Bug
RelatedFieldWidgetWrapper links toggling isn’t working for radio widgets — at Initial Version
Reported by: | Thibaud Colas | Owned by: | Coen van der Kamp |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | yes |
Pull Requests: | 18877 build:success, | ||
Description ¶
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 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.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.