Repository navigation
ChoiceField in rest_framework.fields not support IntEnum #8945
Replies: 1 comment 2 replies
|
does django already support it? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Title
ChoiceField in rest_framework.fields not support IntEnum
env
Python 3.10.1
djangorestframework==3.14.0
question
I have a model defined like this:
When I post a request to save a job with status=1, the server give me a "0" is not a valid choice. error.
I reviewed the fields.py and found the 'to_internal_value' method:
Maybe the 'to_internal_value' couldn't handle the IntEnum type choice correctly.
How do you think about it?
All reactions