mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Merge pull request #1301 from linovia/bugfix/tutorial_for_python3
Fix tutorial's step 1 for Python 3
This commit is contained in:
commit
7bdb1b2eef
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user