aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorDanilo Bargen2013-02-25 23:02:42 +0100
committerDanilo Bargen2013-02-25 23:02:42 +0100
commitec4d79bcaf08d577e8c44cad873515d018e21986 (patch)
treeff892f3893d1d6acb5e607fc343a302d5d6720b9 /rest_framework/serializers.py
parent3e6f99e273b3ca4278c417f32f0db1b7bdfe408b (diff)
downloaddjango-rest-framework-ec4d79bcaf08d577e8c44cad873515d018e21986.tar.bz2
Show class name in exception message
Diffstat (limited to 'rest_framework/serializers.py')
-rw-r--r--rest_framework/serializers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index 669e5ae9..d57417d9 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -425,7 +425,8 @@ class ModelSerializer(Serializer):
cls = self.opts.model
if cls is None:
- raise AttributeError("Serializer class is missing 'model' Meta option")
+ raise AttributeError("Serializer class '%s' is missing 'model' Meta option" %
+ self.__class__.__name__)
opts = get_concrete_model(cls)._meta
pk_field = opts.pk
# while pk_field.rel: