Cannot set a read_only field with a default #7897
Unanswered
bespokebob
asked this question in
Potential Issue
Replies: 1 comment
-
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.
-
According to the documentation at https://www.django-rest-framework.org/api-guide/validators/#advanced-field-defaults
This doesn't actually work, though. It passes validation, but the data isn't saved.
My actual use case is a little more complicated since I want to use a
read_only
nested serializer with adefault
, but it seems like it doesn't work for regular fields either.Beta Was this translation helpful? Give feedback.
All reactions