Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3038494

Browse files
Document that unique constraints causerequired=True in ModelSerializer (#9725)
1 parent4bb46c2 commit3038494

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎docs/api-guide/fields.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Set to false if this field is not required to be present during deserialization.
4242

4343
Setting this to`False` also allows the object attribute or dictionary key to be omitted from output when serializing the instance. If the key is not present it will simply not be included in the output representation.
4444

45-
Defaults to`True`. If you're using[Model Serializer](https://www.django-rest-framework.org/api-guide/serializers/#modelserializer)default value will be`False`if you have specified`blank=True` or`default`or`null=True` atyour field in your`Model`.
45+
Defaults to`True`. If you're using[Model Serializer](https://www.django-rest-framework.org/api-guide/serializers/#modelserializer), thedefault value will be`False`when you have specifieda`default`, orwhen the corresponding`Model` field has`blank=True`or`null=True`and is not part of a unique constraintatthe same time. (Note that without a`default` value,[unique constraints will cause the field to be required](https://www.django-rest-framework.org/api-guide/validators/#optional-fields).)
4646

4747
###`default`
4848

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp