diff options
| author | Tom Christie | 2013-02-12 08:57:23 +0000 | 
|---|---|---|
| committer | Tom Christie | 2013-02-12 08:58:28 +0000 | 
| commit | 55fdac4176ac6629481a8cca8dd2463da9c594a2 (patch) | |
| tree | 0b144a0ec8de1b2540450b66d36fd73c76aaa619 /docs/tutorial/5-relationships-and-hyperlinked-apis.md | |
| parent | f5a0275547ad264c8a9b9aa2a45cc461723a4f11 (diff) | |
| download | django-rest-framework-55fdac4176ac6629481a8cca8dd2463da9c594a2.tar.bz2 | |
Use `many=True` for serializers.
Diffstat (limited to 'docs/tutorial/5-relationships-and-hyperlinked-apis.md')
| -rw-r--r-- | docs/tutorial/5-relationships-and-hyperlinked-apis.md | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index de856611..81be333b 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -70,8 +70,8 @@ The `HyperlinkedModelSerializer` has the following differences from `ModelSerial  * It does not include the `pk` field by default.  * It includes a `url` field, using `HyperlinkedIdentityField`. -* Relationships use `HyperlinkedRelatedField` and `ManyHyperlinkedRelatedField`, -  instead of `PrimaryKeyRelatedField` and `ManyPrimaryKeyRelatedField`. +* Relationships use `HyperlinkedRelatedField`, +  instead of `PrimaryKeyRelatedField`.  We can easily re-write our existing serializers to use hyperlinking. @@ -86,7 +86,7 @@ We can easily re-write our existing serializers to use hyperlinking.      class UserSerializer(serializers.HyperlinkedModelSerializer): -        snippets = serializers.ManyHyperlinkedRelatedField(view_name='snippet-detail') +        snippets = serializers.HyperlinkedRelatedField(many=True, view_name='snippet-detail')          class Meta:              model = User | 
