Add note on compat import in tutorial

This commit is contained in:
Tom Christie 2013-12-17 09:45:28 +00:00
parent 7bdb1b2eef
commit 02ae1682b5

View File

@ -183,6 +183,8 @@ 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...
# 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
stream = BytesIO(content)