diff options
| author | Danilo Bargen | 2013-02-25 22:34:05 +0100 |
|---|---|---|
| committer | Danilo Bargen | 2013-02-25 22:34:05 +0100 |
| commit | 3e6f99e273b3ca4278c417f32f0db1b7bdfe408b (patch) | |
| tree | 05704c710637bb511cd71109aa43d3e235e285cf /rest_framework/serializers.py | |
| parent | 8da83f0df9761550cbcac88850a659aab00a2506 (diff) | |
| download | django-rest-framework-3e6f99e273b3ca4278c417f32f0db1b7bdfe408b.tar.bz2 | |
Improved exception message for missing serializer model meta option
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 266a2402..669e5ae9 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -424,6 +424,8 @@ class ModelSerializer(Serializer): """ cls = self.opts.model + if cls is None: + raise AttributeError("Serializer class is missing 'model' Meta option") opts = get_concrete_model(cls)._meta pk_field = opts.pk # while pk_field.rel: |
