aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide
diff options
context:
space:
mode:
authorTom Christie2013-02-08 09:01:45 +0000
committerTom Christie2013-02-08 09:01:45 +0000
commitfd57978cb757597b82b58df78c52dc98eaed875e (patch)
treef5372691f93150ae90bfc7dd71834572bf13afbf /docs/api-guide
parent15c8fd96ef34cb48bd85f7f886c8c0db71c73cff (diff)
downloaddjango-rest-framework-fd57978cb757597b82b58df78c52dc98eaed875e.tar.bz2
Add missing `model =` to serializer classes in docs
Diffstat (limited to 'docs/api-guide')
-rw-r--r--docs/api-guide/relations.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/api-guide/relations.md b/docs/api-guide/relations.md
index aedff96e..c5da084b 100644
--- a/docs/api-guide/relations.md
+++ b/docs/api-guide/relations.md
@@ -46,6 +46,7 @@ For example, the following serializer.
tracks = RelatedField(many=True)
class Meta:
+ model = Album
fields = ('album_name', 'artist', 'tracks')
Would serialize to the following representation.
@@ -73,6 +74,7 @@ For example, the following serializer:
tracks = PrimaryKeyRelatedField(many=True, read_only=True)
class Meta:
+ model = Album
fields = ('album_name', 'artist', 'tracks')
Would serialize to a representation like this:
@@ -106,6 +108,7 @@ For example, the following serializer:
view_name='track-detail')
class Meta:
+ model = Album
fields = ('album_name', 'artist', 'tracks')
Would serialize to a representation like this:
@@ -143,6 +146,7 @@ For example, the following serializer:
tracks = SlugRelatedField(many=True, read_only=True, slug_field='title')
class Meta:
+ model = Album
fields = ('album_name', 'artist', 'tracks')
Would serialize to a representation like this:
@@ -176,6 +180,7 @@ This field can be applied as an identity relationship, such as the `'url'` field
track_listing = HyperLinkedIdentityField(view_name='track-list')
class Meta:
+ model = Album
fields = ('album_name', 'artist', 'track_listing')
Would serialize to a representation like this:
@@ -208,6 +213,7 @@ Nested relationships can be expressed by using serializers as fields. For examp
tracks = TrackSerializer(many=True)
class Meta:
+ model = Album
fields = ('album_name', 'artist', 'tracks')
Note that nested relationships are currently read-only. For read-write relationships, you should use a flat relational style.