1
1
mirror of https://github.com/encode/django-rest-framework.git synced 2025-07-10 08:12:25 +03:00

Fix in documentation ()

- model serializers now must provide either "fields" or "exclude" as attribute
This commit is contained in:
Alexei Znamensky 2017-11-20 21:07:36 +13:00 committed by Carlton Gibson
parent 2531998427
commit 20954469b2

View File

@ -493,6 +493,8 @@ The names in the `fields` and `exclude` attributes will normally map to model fi
Alternatively names in the `fields` options can map to properties or methods which take no arguments that exist on the model class.
Since version 3.3.0, it is **mandatory** to provide one of the attributes `fields` or `exclude`.
## Specifying nested serialization
The default `ModelSerializer` uses primary keys for relationships, but you can also easily generate nested representations using the `depth` option: