diff options
| author | Tom Christie | 2014-12-17 14:14:51 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-12-17 14:14:51 +0000 | 
| commit | c6137bbf5aa7ca800e4afc06657e5196b2e0e481 (patch) | |
| tree | e857abf77665e4a6562caf84fb968be25c7c9309 /docs | |
| parent | 426547c61c725ca7dc47671c084d1a2805c92305 (diff) | |
| download | django-rest-framework-c6137bbf5aa7ca800e4afc06657e5196b2e0e481.tar.bz2 | |
Serializer API restrictions.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api-guide/serializers.md | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index 5fe6b4c2..137cc9d5 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -240,6 +240,12 @@ Serializer classes can also include reusable validators that are applied to the  For more information see the [validators documentation](validators.md). +## Accessing the initial data and instance + +When passing an initial object or queryset to a serializer instance, the object will be made available as `.instance`. If no initial object is passed then the `.instance` attribute will be `None`. + +When passing data to a serializer instance, the unmodified data will be made available as `.initial_data`. If the data keyword argument is not passed then the `.initial_data` attribute will not exist. +  ## 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. | 
