Commit 80bacc5f by Tom Christie

depth should reduce by one on each nesting level. Closes #2287.

parent e0096fe8
......@@ -1112,7 +1112,7 @@ class ModelSerializer(Serializer):
class NestedSerializer(ModelSerializer):
class Meta:
model = relation_info.related
depth = nested_depth
depth = nested_depth - 1
return NestedSerializer
......@@ -1139,6 +1139,6 @@ class HyperlinkedModelSerializer(ModelSerializer):
class NestedSerializer(HyperlinkedModelSerializer):
class Meta:
model = relation_info.related
depth = nested_depth
depth = nested_depth - 1
return NestedSerializer
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment