aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorTom Christie2014-01-10 05:25:21 -0800
committerTom Christie2014-01-10 05:25:21 -0800
commitb61cef435ec33e50ddb4d9b054dce76c186e9470 (patch)
tree17dfb8e20d81f10b48aa7343973c9b5d3646ec08 /docs
parent593cf23ac8061efbc7cb72e2e0d29d277df2ef76 (diff)
parent4b8d1b66ab2184166192e0c1ffea9b5f11fff8d3 (diff)
downloaddjango-rest-framework-b61cef435ec33e50ddb4d9b054dce76c186e9470.tar.bz2
Merge pull request #1345 from bodylabs/serializers_doc
serializers.md: Fix typos
Diffstat (limited to 'docs')
-rw-r--r--docs/api-guide/serializers.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index 6fc25f57..04439092 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -103,11 +103,11 @@ Deserialization is similar. First we parse a stream into Python native datatype
When deserializing data, we can either create a new instance, or update an existing instance.
serializer = CommentSerializer(data=data) # Create new instance
- serializer = CommentSerializer(comment, data=data) # Update `instance`
+ serializer = CommentSerializer(comment, data=data) # Update `comment`
By default, serializers must be passed values for all required fields or they will throw validation errors. You can use the `partial` argument in order to allow partial updates.
- serializer = CommentSerializer(comment, data={'content': u'foo bar'}, partial=True) # Update `instance` with partial data
+ serializer = CommentSerializer(comment, data={'content': u'foo bar'}, partial=True) # Update `comment` with partial data
## Validation
@@ -208,7 +208,7 @@ Similarly if a nested representation should be a list of items, you should pass
Validation of nested objects will work the same as before. Errors with nested objects will be nested under the field name of the nested object.
- serializer = CommentSerializer(comment, data={'user': {'email': 'foobar', 'username': 'doe'}, 'content': 'baz'})
+ serializer = CommentSerializer(data={'user': {'email': 'foobar', 'username': 'doe'}, 'content': 'baz'})
serializer.is_valid()
# False
serializer.errors