mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
Merge pull request #2798 from Boomerangz/depth-should-reduce
Depth should reduce on nested ModelSerializer classes.
This commit is contained in:
commit
2eb9107b87
|
@ -1038,7 +1038,7 @@ class ModelSerializer(Serializer):
|
|||
class NestedSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = relation_info.related_model
|
||||
depth = nested_depth
|
||||
depth = nested_depth - 1
|
||||
|
||||
field_class = NestedSerializer
|
||||
field_kwargs = get_nested_relation_kwargs(relation_info)
|
||||
|
|
Loading…
Reference in New Issue
Block a user