Fix broken depth argument

This commit is contained in:
Tom Christie 2012-11-13 11:47:32 +00:00
parent 02c1b5988b
commit 21468a1867
2 changed files with 5 additions and 1 deletions

View File

@ -388,7 +388,10 @@ class ModelSerializer(Serializer):
""" """
Creates a default instance of a nested relational field. 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): def get_related_field(self, model_field, to_many=False):
""" """

View File

@ -136,6 +136,7 @@ class PrimaryKeyManyToManyTests(TestCase):
] ]
self.assertEquals(serializer.data, expected) self.assertEquals(serializer.data, expected)
class PrimaryKeyForeignKeyTests(TestCase): class PrimaryKeyForeignKeyTests(TestCase):
def setUp(self): def setUp(self):
target = ForeignKeyTarget(name='target-1') target = ForeignKeyTarget(name='target-1')