Re: Using a RadioSelect widget with ModelChoiceField

2021-02-06 Thread Matt Rowbottom
Hi wne Thanks again for the suggestion, but those solutions are for how to make a `ChoiceField` behave like a `ModelChoiceField`. My `ModelChoiceField` works fine while the default `Select` widget is used. But when I use the `RadioSelect` widget the blank option disappears. This only occurs i

Re: Using a RadioSelect widget with ModelChoiceField

2021-02-05 Thread Siarhei Siarhei
https://stackoverflow.com/questions/14541074/empty-label-choicefield-django суббота, 6 февраля 2021 г. в 06:31:52 UTC+3, Matt Rowbottom: > Hi wne > > Using `to_field_name` changes the value of the options/inputs, but doesn't > seem to have any effect on whether a blank option is available. Usi

Re: Using a RadioSelect widget with ModelChoiceField

2021-02-05 Thread Matt Rowbottom
Hi wne Using `to_field_name` changes the value of the options/inputs, but doesn't seem to have any effect on whether a blank option is available. Using `required=False` should provide a blank option. Below is a pic of how it's rendering. Animal Radio is missing a blank option. [image: Scree

Re: Using a RadioSelect widget with ModelChoiceField

2021-02-05 Thread Siarhei Siarhei
to_field_name="name", пятница, 5 февраля 2021 г. в 17:15:27 UTC+3, Matt Rowbottom: > Hello. I think I've found a bug. > > Prior to Django v3.1, both of the fields in the following form would be > rendered with an empty option, labelled as '-': > > ``` > from django import forms > from .

Using a RadioSelect widget with ModelChoiceField

2021-02-05 Thread Matt Rowbottom
Hello. I think I've found a bug. Prior to Django v3.1, both of the fields in the following form would be rendered with an empty option, labelled as '-': ``` from django import forms from .models import Animal class AnimalForm(forms.Form): animal_select = forms.ModelChoiceField(