mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
depth should reduce by one on each nesting level. Closes #2287.
This commit is contained in:
parent
e0096fe80c
commit
80bacc5fb0
|
@ -1112,7 +1112,7 @@ class ModelSerializer(Serializer):
|
||||||
class NestedSerializer(ModelSerializer):
|
class NestedSerializer(ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = relation_info.related
|
model = relation_info.related
|
||||||
depth = nested_depth
|
depth = nested_depth - 1
|
||||||
|
|
||||||
return NestedSerializer
|
return NestedSerializer
|
||||||
|
|
||||||
|
@ -1139,6 +1139,6 @@ class HyperlinkedModelSerializer(ModelSerializer):
|
||||||
class NestedSerializer(HyperlinkedModelSerializer):
|
class NestedSerializer(HyperlinkedModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = relation_info.related
|
model = relation_info.related
|
||||||
depth = nested_depth
|
depth = nested_depth - 1
|
||||||
|
|
||||||
return NestedSerializer
|
return NestedSerializer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user