From 760da25c6018eff02b3aab33dc6fea7c93881d9f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 17 Dec 2014 16:23:42 +0000 Subject: Update documentation --- tutorial/1-serialization/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tutorial/1-serialization/index.html') diff --git a/tutorial/1-serialization/index.html b/tutorial/1-serialization/index.html index 435d47e6..5682989c 100644 --- a/tutorial/1-serialization/index.html +++ b/tutorial/1-serialization/index.html @@ -535,7 +535,7 @@ content
Deserialization is similar. First we parse a stream into Python native datatypes...
# This import will use either `StringIO.StringIO` or `io.BytesIO`
# as appropriate, depending on if we're running Python 2 or Python 3.
-from rest_framework.compat import BytesIO
+from django.utils.six import BytesIO
stream = BytesIO(content)
data = JSONParser().parse(stream)
@@ -565,7 +565,7 @@ Open the file snippets/serializers.py again, and edit the Sni
model = Snippet
fields = ('id', 'title', 'code', 'linenos', 'language', 'style')
-One nice property that serializers have is that you can inspect all the fields in a serializer instance, by printing it's representation. Open the Django shell with python manange.py shell, then try the following:
One nice property that serializers have is that you can inspect all the fields in a serializer instance, by printing it's representation. Open the Django shell with python manage.py shell, then try the following:
>>> from snippets.serializers import SnippetSerializer
>>> serializer = SnippetSerializer()
>>> print(repr(serializer))
--
cgit v1.2.3