diff options
| author | Tom Christie | 2014-12-11 09:54:55 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-12-11 09:54:55 +0000 |
| commit | 9b88b5db694b4cc68b87c87d967f912a47fa5817 (patch) | |
| tree | cf874508df46f4e7c77aa584f184cfbf28476adf | |
| parent | 313c36faca20b872f649f2fcea6c783f2d20fe72 (diff) | |
| download | django-rest-framework-9b88b5db694b4cc68b87c87d967f912a47fa5817.tar.bz2 | |
Field->ReadOnlyField in tutorial docs
| -rw-r--r-- | docs/tutorial/5-relationships-and-hyperlinked-apis.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index 57e3b6c5..c21efd7f 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -75,7 +75,7 @@ The `HyperlinkedModelSerializer` has the following differences from `ModelSerial 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: |
