Hello,
I have a Django model with IntegerField with choices, and null=True, blank=True. I've written a simple
CreateAPIView and a serializer for the model. I haven't overriden any fields in the serializer.
The only issue I'm having is when I'm adding objects by using the form in the API browser and I leave
the choices field blank (the form correctly displays the blank option). I get the following exception:
invalid literal for int() with base 10: ''
I've tried overriding the field in the serializer with ChoiceField from Django Rest Framework and
setting required=False, but this doesn't work either.
Since everything works fine when I use the API with JSON, this is a minor issue, but I'd like to
know why it isn't working as expected.
Thanks in advance,
Milorad