-
Notifications
You must be signed in to change notification settings - Fork 766
convert DRF ChoiceField to Enum #537
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
Conversation
Tests do pass, but can't directly trigger a rebuild. For some reason the CI broke (seems rarely intermittent):
|
I hit this issue today. Is there a workaround you would recommend that will allow me to have a schema where enums are used for Django choice fields when using the serializer mutation? |
Ideally, there would be a way to override the defaults for the inputs and outputs. |
@cowlicks you can always redefine the field where you define your own |
PR now converts multiple choices fields to list of enums. Now the remaining question is whether it makes sense for FilePathField to be an enum. Choices may not be static as new directories could be added. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@zbyte64 is this still a PR that you would like to see merged? |
This is still an issue and I still believe this is a valid way to address the issue. So yes, we should merge it... |
Merging this PR because it's been waiting around for ages. |
@zbyte64 Can you direct me to the example where I see this change in action? I tried it but didn't work, maybe I didn't understand it correctly. I'm using v2.5.0 |
This is to resolve #517 so that we use choices defined from DRF.
This also impacts
FilePathField
as it is technically aChoiceField
.