From f21bf4d6dd7ed90b59945704f818732135ac86c4 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 11 Dec 2014 09:42:21 +0000 Subject: Update documentation --- tutorial/5-relationships-and-hyperlinked-apis/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tutorial/5-relationships-and-hyperlinked-apis/index.html') diff --git a/tutorial/5-relationships-and-hyperlinked-apis/index.html b/tutorial/5-relationships-and-hyperlinked-apis/index.html index 52ecf307..5742c884 100644 --- a/tutorial/5-relationships-and-hyperlinked-apis/index.html +++ b/tutorial/5-relationships-and-hyperlinked-apis/index.html @@ -447,7 +447,7 @@ We'll add a url pattern for our new API root in snippets/urls.py:

We can easily re-write our existing serializers to use hyperlinking. In your snippets/serializers.py add:

class SnippetSerializer(serializers.HyperlinkedModelSerializer):
-    owner = serializers.Field(source='owner.username')
+    owner = serializers.ReadOnlyField(source='owner.username')
     highlight = serializers.HyperlinkedIdentityField(view_name='snippet-highlight', format='html')
 
     class Meta:
@@ -457,7 +457,7 @@ We'll add a url pattern for our new API root in snippets/urls.py:
   
   
-