tomchristie/django-rest-framework — pull request #2077 by gregmuellegger (2014-11-15 14:30:36+00:00)
Title: More helpful error message when default `.create` fails. Closes #2013.

The traceback is kept the same, but we append a more helpful message to the original one.

```
Traceback (most recent call last):
File "/home/gregor/projects/django-rest-framework/tests/test_model_serializer.py", line 93, in test_create_method
serializer.save()
File "/home/gregor/projects/django-rest-framework/rest_framework/serializers.py", line 123, in save
self.instance = self.create(validated_data)
File "/home/gregor/projects/django-rest-framework/rest_framework/serializers.py", line 608, in create
sys.exc_info()[2])
File "/home/gregor/projects/django-rest-framework/rest_framework/serializers.py", line 598, in create
instance = ModelClass.objects.create(**validated_attrs)
File "/home/gregor/projects/django-rest-framework/.venv/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/gregor/projects/django-rest-framework/.venv/lib/python2.7/site-packages/django/db/models/query.py", line 370, in create
obj = self.model(**kwargs)
File "/home/gregor/projects/django-rest-framework/.venv/lib/python2.7/site-packages/django/db/models/base.py", line 454, in __init__
raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
TypeError: 'non_model_field' is an invalid keyword argument for this function. The mentioned argument might be a field on the serializer that is not part of the model. You need to override the create() method in your ModelSerializer subclass to support this.
```