From 33d48041b8e8218c2b5ebb1f8fc725d272fb789c Mon Sep 17 00:00:00 2001 From: eofs Date: Mon, 14 Jan 2013 16:16:03 +0200 Subject: [PATCH] Docs updated --- docs/api-guide/serializers.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index d98a602f7..4bc822d41 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -243,6 +243,16 @@ The `RelatedField` class may be subclassed to create a custom representation of All the relational fields may be used for any relationship or reverse relationship on a model. +## Reverse relational fields + +By default reverse relational fields are not displayed when ModelSerializer is used. You can control this behavior by using `INCLUDE_REVERSE_RELATIONS` setting. + +Besides global setting you can also use model specific setting: + + class BlogPostSerializer(serializer.ModelSerializer): + class Meta: + include_reverse_relations = True + ## Specifying which fields should be included If you only want a subset of the default fields to be used in a model serializer, you can do so using `fields` or `exclude` options, just as you would with a `ModelForm`.