mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
documenting use of setting
This commit is contained in:
parent
2e00290955
commit
32d91e089b
|
@ -255,7 +255,8 @@ When passing data to a serializer instance, the unmodified data will be made ava
|
|||
|
||||
## 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
|
||||
serializer = CommentSerializer(comment, data={'content': 'foo bar'}, partial=True)
|
||||
|
|
Loading…
Reference in New Issue
Block a user