tomchristie/django-rest-framework — pull request #683 by dbrgn (2013-02-25 21:37:11+00:00)
Title: Improved exception message for missing serializer model meta option

The default exception when forgetting or mistyping the `model` meta option in a serializer is `AttributeError: 'NoneType' object has no attribute '_meta'`.

I added a check which raises an AttributeError with the message `Serializer class is missing 'model' Meta option`. This should make things clearer.

Possibly an even better alternative would be an AssertionError instead of an AttributeError, which is slightly misleading.

Test is provided and runs on all tox targets.