OPTIONS could easily return the default of a serializer #8003
Unanswered
john-parton
asked this question in
Ideas & Suggestions
Replies: 1 comment
-
|
I would really benefit from such a feature for the InvenTree project, as well as #8002 |
Beta Was this translation helpful? Give feedback.
0 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.
-
This only works if you apply this PR/patch: #8002
If you override
rest_framework.metadata.SimpleMetadataas follows, then you get the field default when you do anOPTIONSquery.Like magic, for every field:
Here's my branch with the fix for missing
defaultand the feature to adddefaultto theOPTIONSrequest: https://github.com/john-parton/django-rest-framework/tree/feature/include-defaults-in-optionsShould this feature be the default behavior? I would happily submit a PR
Beta Was this translation helpful? Give feedback.
All reactions