diff options
| author | Tom Christie | 2014-12-19 14:52:53 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-12-19 14:52:53 +0000 | 
| commit | 80bacc5fb00682b589b3280c7082af73e3aaa8f8 (patch) | |
| tree | d424ea207bd23c64879772625b0c21d10a0830c8 | |
| parent | e0096fe80c95d932dad0490ef2838756e7be6bf7 (diff) | |
| download | django-rest-framework-80bacc5fb00682b589b3280c7082af73e3aaa8f8.tar.bz2 | |
depth should reduce by one on each nesting level. Closes #2287.
| -rw-r--r-- | rest_framework/serializers.py | 4 | 
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 | 
