documenting use of setting

This commit is contained in:
Christian 2022-05-14 22:13:30 +01:00 committed by GitHub
parent 2e00290955
commit 32d91e089b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,7 +255,8 @@ When passing data to a serializer instance, the unmodified data will be made ava
## Partial updates ## Partial updates
By default, serializers must be passed values for all required fields or they will raise validation errors. You can use the `partial` argument in order to allow partial updates. By default, serializers must be passed values for all required fields or they will raise validation errors. You can use the `partial` argument in order to allow partial updates. Note that `STRICT_PARTIAL_UPDATE` must be set to `True` to enable field specific updates using `.save(update_fields=[...])` for `ModelSerializer`
with `partial=True`.
# Update `comment` with partial data # Update `comment` with partial data
serializer = CommentSerializer(comment, data={'content': 'foo bar'}, partial=True) serializer = CommentSerializer(comment, data={'content': 'foo bar'}, partial=True)