From 9defb5ee9f0090f98fa579f1e74b7dfdd6138744 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 27 Nov 2014 11:01:21 +0000 Subject: Update documentation --- tutorial/1-serialization/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tutorial') diff --git a/tutorial/1-serialization/index.html b/tutorial/1-serialization/index.html index ae558ebc..acdb0893 100644 --- a/tutorial/1-serialization/index.html +++ b/tutorial/1-serialization/index.html @@ -563,7 +563,7 @@ Open the file snippets/serializers.py again, and edit the Sni model = Snippet fields = ('id', 'title', 'code', 'linenos', 'language', 'style') -

Once nice property that serializers have is that you can inspect all the fields an serializer instance, by printing it's representation. Open the Django shell with python manange.py shell, then try the following:

+

One nice property that serializers have is that you can inspect all the fields in a serializer instance, by printing it's representation. Open the Django shell with python manange.py shell, then try the following:

>>> from snippets.serializers import SnippetSerializer
 >>> serializer = SnippetSerializer()
 >>> print repr(serializer)  # In python 3 use `print(repr(serializer))`
@@ -575,7 +575,7 @@ SnippetSerializer():
     language = ChoiceField(choices=[('Clipper', 'FoxPro'), ('Cucumber', 'Gherkin'), ('RobotFramework', 'RobotFramework'), ('abap', 'ABAP'), ('ada', 'Ada')...
     style = ChoiceField(choices=[('autumn', 'autumn'), ('borland', 'borland'), ('bw', 'bw'), ('colorful', 'colorful')...
 
-

It's important to remember that ModelSerializer classes don't do anything particularly magically, they are simply a shortcut to creating a serializer class with:

+

It's important to remember that ModelSerializer classes don't do anything particularly magical, they are simply a shortcut for creating serializer classes: