-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
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
ChoiceField with required=False not optional in HTML view #2184
Comments
Looks like we may currently support this in Still surprising tho as you do also have It'd be helpful to see the serializer field it generates - could you do |
Unfortunately, that is not very helpful:
Ok, from within the program, did a print(repr(serializer.get_fields())) instead. That gives me:
Which lists all the choices except for the None choice. Is this what you where after? |
You were missing the
Yes, thank you. |
To do: Add |
Working on this, but having trouble figuring out what tests should be added. |
Add allow_blank for ChoiceField #2184
Hello,
I have a db model containing:
ModelSerializer I believe turns this into a ChoiceField.
Unfortunately the choice list doesn't list an appropriate value to correspond with None.
I have tried setting required=False, but it has no affect.
Thanks.
The text was updated successfully, but these errors were encountered: