django-crispy-forms / django-crispy-forms/crispy-tailwind
[bug] checkboxmultipleselect is a radio
- Dominant language
- HTML
- Stars
- 423
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
as per https://github.com/django/django/blob/main/django/forms/widgets.py#L839
unfortunately the widget inherits from radioselect which means that isinstance will return true an show a radio select due to the order in https://github.com/django-crispy-forms/crispy-tailwind/blob/main/crispy_tailwind/templates/tailwind/field.html#L20
as is demonstrated here
```
(Pdb) isinstance(form.fields.get('infrastructure').widget, forms.CheckboxSelectMultiple)
True
(Pdb) isinstance(form.fields.get('infrastructure').widget, forms.RadioSelect)
True
```
a working fix would be to test for the class name rather?
```
form.fields.get('infrastructure').widget.__class__.__name__
'CheckboxSelectMultiple'
```
Contributor guide
Assessment
This issue has not been assessed yet.