Merge pull request #1301 from linovia/bugfix/tutorial_for_python3

Fix tutorial's step 1 for Python 3
This commit is contained in:
Tom Christie 2013-12-17 01:42:47 -08:00
commit 7bdb1b2eef

View File

@ -183,9 +183,9 @@ At this point we've translated the model instance into Python native datatypes.
Deserialization is similar. First we parse a stream into Python native datatypes... Deserialization is similar. First we parse a stream into Python native datatypes...
import StringIO from rest_framework.compat import BytesIO
stream = StringIO.StringIO(content) stream = BytesIO(content)
data = JSONParser().parse(stream) data = JSONParser().parse(stream)
...then we restore those native datatypes into to a fully populated object instance. ...then we restore those native datatypes into to a fully populated object instance.