Skip to content

Commit

Permalink
Merge pull request #2798 from Boomerangz/depth-should-reduce
Browse files Browse the repository at this point in the history
Depth should reduce on nested ModelSerializer classes.
  • Loading branch information
tomchristie committed Apr 27, 2015
2 parents 2394577 + 2d5b4f4 commit 2eb9107
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def build_nested_field(self, field_name, relation_info, nested_depth):
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)
Expand Down

0 comments on commit 2eb9107

Please sign in to comment.