Replies: 1 comment 2 replies
-
does django already support it? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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?
Beta Was this translation helpful? Give feedback.
All reactions