aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/serializers.md
diff options
context:
space:
mode:
authorVictor Shih2013-05-01 21:26:40 -0700
committerVictor Shih2013-05-01 21:26:40 -0700
commit8cabae22c5330da2e0a15a6d61ef038a6447756a (patch)
treefbebe8abad45c92f9dc0d3bb87b1d1ecbbdeeb61 /docs/api-guide/serializers.md
parent198b679e02954ebcfac37e9d0146caf575df4f5a (diff)
downloaddjango-rest-framework-8cabae22c5330da2e0a15a6d61ef038a6447756a.tar.bz2
Example and spelling fixes. Change "browseable" to "browsable" for consistency.
Diffstat (limited to 'docs/api-guide/serializers.md')
-rw-r--r--[-rwxr-xr-x]docs/api-guide/serializers.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index 2797b5f5..98c6fbba 100755..100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -59,14 +59,15 @@ We can now use `CommentSerializer` to serialize a comment, or list of comments.
At this point we've translated the model instance into python native datatypes. To finalise the serialization process we render the data into `json`.
- stream = JSONRenderer().render(data)
- stream
+ json = JSONRenderer().render(serializer.data)
+ json
# '{"email": "leila@example.com", "content": "foo bar", "created": "2012-08-22T16:20:09.822"}'
## Deserializing objects
Deserialization is similar. First we parse a stream into python native datatypes...
+ stream = StringIO(json)
data = JSONParser().parse(stream)
...then we restore those native datatypes into a fully populated object instance.