Skip to content
Prev Previous commit
Next Next commit
Add an explicit fields = '__all__' on automatically generated ModelSe…
…rializers
  • Loading branch information
lovelydinosaur committed Jun 2, 2016
commit c4bc584b98bbc75cd5911810341b5cd114cc6427
2 changes: 2 additions & 0 deletions rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ class NestedSerializer(ModelSerializer):
class Meta:
model = relation_info.related_model
depth = nested_depth - 1
fields = '__all__'

field_class = NestedSerializer
field_kwargs = get_nested_relation_kwargs(relation_info)
Expand Down Expand Up @@ -1469,6 +1470,7 @@ class NestedSerializer(HyperlinkedModelSerializer):
class Meta:
model = relation_info.related_model
depth = nested_depth - 1
fields = '__all__'

field_class = NestedSerializer
field_kwargs = get_nested_relation_kwargs(relation_info)
Expand Down