Commit d738ad7a by Xavier Ordoquy

Update to serialization results (closes #3881).

parent 72372efd
...@@ -43,7 +43,7 @@ We can now use `CommentSerializer` to serialize a comment, or list of comments. ...@@ -43,7 +43,7 @@ We can now use `CommentSerializer` to serialize a comment, or list of comments.
serializer = CommentSerializer(comment) serializer = CommentSerializer(comment)
serializer.data serializer.data
# {'email': u'leila@example.com', 'content': u'foo bar', 'created': datetime.datetime(2012, 8, 22, 16, 20, 9, 822774)} # {'email': 'leila@example.com', 'content': 'foo bar', 'created': '2016-01-27T15:17:10.375877'}
At this point we've translated the model instance into Python native datatypes. To finalise the serialization process we render the data into `json`. At this point we've translated the model instance into Python native datatypes. To finalise the serialization process we render the data into `json`.
...@@ -51,7 +51,7 @@ At this point we've translated the model instance into Python native datatypes. ...@@ -51,7 +51,7 @@ At this point we've translated the model instance into Python native datatypes.
json = JSONRenderer().render(serializer.data) json = JSONRenderer().render(serializer.data)
json json
# '{"email": "leila@example.com", "content": "foo bar", "created": "2012-08-22T16:20:09.822"}' # b'{"email":"leila@example.com","content":"foo bar","created":"2016-01-27T15:17:10.375877"}'
## Deserializing objects ## Deserializing objects
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment