We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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'
The text was updated successfully, but these errors were encountered:
Seconded on this one:
This is how django-crispy-forms handles it:
django-crispy-forms
https://github.com/django-crispy-forms/django-crispy-forms/blob/main/crispy_forms/templatetags/crispy_forms_field.py
return isinstance(field.field.widget, forms.RadioSelect) and not isinstance( field.field.widget, forms.CheckboxSelectMultiple )
Sorry, something went wrong.
Hi @rosscdh!
Nice to meet you here! 😄
What do you say about @dpjanes suggestion how crispy forms core handles this?
Best Ronny
Successfully merging a pull request may close this issue.
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
a working fix would be to test for the class name rather?
The text was updated successfully, but these errors were encountered: