diff options
Diffstat (limited to 'rest_framework/serializers.py')
| -rw-r--r-- | rest_framework/serializers.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index d2740fc2..d9f9c8cb 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -24,6 +24,7 @@ from rest_framework.utils.field_mapping import ( lookup_class ) import copy +import inspect # Note: We do the following so that users of the framework can use this style: # @@ -268,6 +269,7 @@ class ListSerializer(BaseSerializer): def __init__(self, *args, **kwargs): self.child = kwargs.pop('child', copy.deepcopy(self.child)) assert self.child is not None, '`child` is a required argument.' + assert not inspect.isclass(self.child), '`child` has not been instantiated.' self.context = kwargs.pop('context', {}) kwargs.pop('partial', None) |
