Merge pull request #2798 from Boomerangz/depth-should-reduce

Depth should reduce on nested ModelSerializer classes.
This commit is contained in:
Tom Christie 2015-04-27 16:22:22 +01:00
commit 2eb9107b87

View File

@ -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)