snippets relationship in tutorial should be read_only

This commit is contained in:
Tom Christie 2014-12-09 19:53:27 +00:00
parent 7d70e56ce3
commit 76956beab4

View File

@ -85,7 +85,7 @@ We can easily re-write our existing serializers to use hyperlinking. In your `sn
class UserSerializer(serializers.HyperlinkedModelSerializer):
snippets = serializers.HyperlinkedRelatedField(many=True, view_name='snippet-detail')
snippets = serializers.HyperlinkedRelatedField(many=True, view_name='snippet-detail', read_only=True)
class Meta:
model = User