mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 19:14:01 +03:00
Fix in documentation (#5611)
- model serializers now must provide either "fields" or "exclude" as attribute
This commit is contained in:
parent
2531998427
commit
20954469b2
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user