diff options
| author | Tom Christie | 2014-09-19 16:43:13 +0100 |
|---|---|---|
| committer | Tom Christie | 2014-09-19 16:43:13 +0100 |
| commit | cf72b9a8b755652cec4ad19a27488e3a79c2e401 (patch) | |
| tree | c9720850a9b670d62028c8451e1cbbd69b3fc6bb /rest_framework/serializers.py | |
| parent | b361c54c5c198583e5085cf49ef44291ec09d2e8 (diff) | |
| download | django-rest-framework-cf72b9a8b755652cec4ad19a27488e3a79c2e401.tar.bz2 | |
Moar tests
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) |
