You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -181,7 +181,7 @@ Deserialization is similar. First we parse a stream into Python native datatype
181
181
serializer = SnippetSerializer(data=data)
182
182
serializer.is_valid()
183
183
# True
184
-
serializer.object
184
+
serializer.save()
185
185
# <Snippet: Snippet object>
186
186
187
187
Notice how similar the API is to working with forms. The similarity should become even more apparent when we start writing views that use our serializer.
@@ -210,7 +210,7 @@ One nice property that serializers have is that you can inspect all the fields i
210
210
211
211
>>> from snippets.serializers import SnippetSerializer
212
212
>>> serializer = SnippetSerializer()
213
-
>>> print repr(serializer) # In python 3 use `print(repr(serializer))`
213
+
>>> print(repr(serializer))
214
214
SnippetSerializer():
215
215
id = IntegerField(label='ID', read_only=True)
216
216
title = CharField(allow_blank=True, max_length=100, required=False)
@@ -301,7 +301,7 @@ We'll also need a view which corresponds to an individual snippet, and can be us
301
301
302
302
Finally we need to wire these views up. Create the `snippets/urls.py` file:
0 commit comments