mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Fix broken depth argument
This commit is contained in:
parent
02c1b5988b
commit
21468a1867
|
@ -388,7 +388,10 @@ class ModelSerializer(Serializer):
|
|||
"""
|
||||
Creates a default instance of a nested relational field.
|
||||
"""
|
||||
return ModelSerializer()
|
||||
class NestedModelSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = model_field.rel.to
|
||||
return NestedModelSerializer()
|
||||
|
||||
def get_related_field(self, model_field, to_many=False):
|
||||
"""
|
||||
|
|
|
@ -136,6 +136,7 @@ class PrimaryKeyManyToManyTests(TestCase):
|
|||
]
|
||||
self.assertEquals(serializer.data, expected)
|
||||
|
||||
|
||||
class PrimaryKeyForeignKeyTests(TestCase):
|
||||
def setUp(self):
|
||||
target = ForeignKeyTarget(name='target-1')
|
||||
|
|
Loading…
Reference in New Issue
Block a user