Typos in serializers documentation (#5652)

Fixes #5651.

Change `update()` to `.update()` in serializers documentation to get a
consistency with `.create()`.
This commit is contained in:
Hang Park 2017-12-04 21:00:03 +09:00 committed by Ryan P Kilby
parent 7855d3bd8b
commit 01587b9eb1

View File

@ -73,7 +73,7 @@ Deserialization is similar. First we parse a stream into Python native datatypes
## Saving instances ## Saving instances
If we want to be able to return complete object instances based on the validated data we need to implement one or both of the `.create()` and `update()` methods. For example: If we want to be able to return complete object instances based on the validated data we need to implement one or both of the `.create()` and `.update()` methods. For example:
class CommentSerializer(serializers.Serializer): class CommentSerializer(serializers.Serializer):
email = serializers.EmailField() email = serializers.EmailField()
@ -325,7 +325,7 @@ For updates you'll want to think carefully about how to handle updates to relati
* Ignore the data and leave the instance as it is. * Ignore the data and leave the instance as it is.
* Raise a validation error. * Raise a validation error.
Here's an example for an `update()` method on our previous `UserSerializer` class. Here's an example for an `.update()` method on our previous `UserSerializer` class.
def update(self, instance, validated_data): def update(self, instance, validated_data):
profile_data = validated_data.pop('profile') profile_data = validated_data.pop('profile')