diff options
| author | Tom Christie | 2014-12-17 15:22:40 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-12-17 15:22:40 +0000 | 
| commit | ffc099a2561be259e6ca378886c0e969a2b5db94 (patch) | |
| tree | ec61d3549529e64599116eb49562149ffeab7aed /docs | |
| parent | 1ba822010d0943c67c127f3f62e873b64348ef87 (diff) | |
| parent | 76cfc5eb8a0a0e34a47020f85e9f4b7a94accf5e (diff) | |
| download | django-rest-framework-ffc099a2561be259e6ca378886c0e969a2b5db94.tar.bz2 | |
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
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. | 
