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
Copy file name to clipboardExpand all lines: docs/tutorial/1-serialization.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -193,16 +193,16 @@ Open the file `snippets/serializers.py` again, and replace the `SnippetSerialize
193
193
194
194
One nice property that serializers have is that you can inspect all the fields in a serializer instance, by printing its representation. Open the Django shell with `python manage.py shell`, then try the following:
195
195
196
-
>>> from snippets.serializers import SnippetSerializer
197
-
>>> serializer = SnippetSerializer()
198
-
>>> print(repr(serializer))
199
-
SnippetSerializer():
200
-
id = IntegerField(label='ID', read_only=True)
201
-
title = CharField(allow_blank=True, max_length=100, required=False)
It's important to remember that `ModelSerializer` classes don't do anything particularly magical, they are simply a shortcut for creating serializer classes:
0 commit comments