Docs updated

This commit is contained in:
eofs 2013-01-14 16:16:03 +02:00
parent c8af10349d
commit 33d48041b8

View File

@ -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`.