diff options
| author | Xavier Ordoquy | 2013-12-17 10:30:23 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2013-12-17 10:30:23 +0100 |
| commit | 802648045476f91f1c4b6a9f507cc08625194c2c (patch) | |
| tree | ff1128e4e08c76efb12e61b9219d68c6daaf6bea /docs/tutorial | |
| parent | 889401989948db9e9825478e71aa1611b4390d17 (diff) | |
| download | django-rest-framework-802648045476f91f1c4b6a9f507cc08625194c2c.tar.bz2 | |
Use the BytesIO for buffering bytes and import the one from the compat module.
Diffstat (limited to 'docs/tutorial')
| -rw-r--r-- | docs/tutorial/1-serialization.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index e1c0009c..4d4e7258 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -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... - import StringIO + from rest_framework.compat import BytesIO - stream = StringIO.StringIO(content) + stream = BytesIO(content) data = JSONParser().parse(stream) ...then we restore those native datatypes into to a fully populated object instance. |
