Added .validated_data usage. Closes #2214.

This commit is contained in:
Tom Christie 2014-12-05 12:48:12 +00:00
parent 99a43748eb
commit b7b0fd3e14

View File

@ -173,6 +173,8 @@ Deserialization is similar. First we parse a stream into Python native datatype
serializer = SnippetSerializer(data=data)
serializer.is_valid()
# True
serializer.validated_data
# OrderedDict([('title', ''), ('code', 'print "hello, world"\n'), ('linenos', False), ('language', 'python'), ('style', 'friendly')])
serializer.save()
# <Snippet: Snippet object>