diff options
| author | Michael Marvick | 2015-02-05 19:42:36 -0800 | 
|---|---|---|
| committer | Michael Marvick | 2015-02-05 19:42:36 -0800 | 
| commit | 5bf803b6ed260d9afde47400b7d5e8912a16ecf6 (patch) | |
| tree | 359d357ba086adb064cc50bd44149c5bf3fb6750 /docs/tutorial | |
| parent | 73bd0d539f24d45695615c25a072175c58a4cf98 (diff) | |
| download | django-rest-framework-5bf803b6ed260d9afde47400b7d5e8912a16ecf6.tar.bz2 | |
Revert some of the changes made in 1-serialization.md
Diffstat (limited to 'docs/tutorial')
| -rw-r--r-- | docs/tutorial/1-serialization.md | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index 458161d0..80e869ea 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -151,7 +151,7 @@ We've now got a few snippet instances to play with.  Let's take a look at serial      serializer = SnippetSerializer(snippet)      serializer.data -    # ReturnDict([('pk', 2), ('title', u''), ('code', u'print "hello, world"\n'), ('linenos', False), ('language', 'python'), ('style', 'friendly')]) +    # {'pk': 2, 'title': u'', 'code': u'print "hello, world"\n', 'linenos': False, 'language': u'python', 'style': u'friendly'}  At this point we've translated the model instance into Python native datatypes.  To finalize the serialization process we render the data into `json`. @@ -182,8 +182,7 @@ We can also serialize querysets instead of model instances.  To do so we simply      serializer = SnippetSerializer(Snippet.objects.all(), many=True)      serializer.data -    # [OrderedDict([('pk', 1), ('title', u''), ('code', u'foo = "bar"\n'), ('linenos', False), ('language', 'python'), ('style', 'friendly')]), OrderedDict([('pk', 2), ('title', u''), ('code', u'print "hello, world"\n'), ('linenos', False), ('language', 'python'), ('style', 'friendly')]), OrderedDict([('pk', 3), ('title', u''), ('code', u'print "hello, world"\n'), ('linenos', False), ('language', 'python'), ('style', 'friendly')])] - +    # [{'pk': 1, 'title': u'', 'code': u'foo = "bar"\n', 'linenos': False, 'language': u'python', 'style': u'friendly'}, {'pk': 2, 'title': u'', 'code': u'print "hello, world"\n', 'linenos': False, 'language': u'python', 'style': u'friendly'}]  ## Using ModelSerializers | 
