uniqueness validator at the serializer level does not support add default automatically. #8153
Unanswered
elonzh
asked this question in
Potential Issue
Replies: 0 comments
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.
-
ModelSerializer
will adddefault
automatically when generate uniqueness extra kwargs from Model definition(byrest_framework.serializers.ModelSerializer.get_uniqueness_extra_kwargs
), which is useful when we have nullable uniqueness constraints.But when we want to add a uniqueness validator at the serializer level, this feature is disabled and we need to set default explicitly.
Beta Was this translation helpful? Give feedback.
All reactions