aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2014-12-19 14:52:53 +0000
committerTom Christie2014-12-19 14:52:53 +0000
commit80bacc5fb00682b589b3280c7082af73e3aaa8f8 (patch)
treed424ea207bd23c64879772625b0c21d10a0830c8
parente0096fe80c95d932dad0490ef2838756e7be6bf7 (diff)
downloaddjango-rest-framework-80bacc5fb00682b589b3280c7082af73e3aaa8f8.tar.bz2
depth should reduce by one on each nesting level. Closes #2287.
-rw-r--r--rest_framework/serializers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index ed709d84..6f89df0d 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -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