toastdriven/django-tastypie — pull request #1019 by ianawilson (2013-08-26 01:39:02+00:00)
Title: Handling of ValidationError can lose field names because it uses ValidationError.messages even when ValidationError.message_dict is available.

As of 0.10.0, if a ``ValidationError`` is raised by the model, Tastypie simply looks for a ``messages`` attribute holding a list of errors.

https://github.com/toastdriven/django-tastypie/blob/v0.10.0/tastypie/resources.py#L221

However, ``ValidationErrors.message_dict`` is much more useful if it is available because it tells you what fields your errors are on. And, this will give errors much more in line with what is provided for an ``ApiFieldError``.

https://github.com/django/django/blob/1.5.2/django/core/exceptions.py#L63

I am happy to contribute a pull request for this issue, and I'm planning to model the test case after the existing validation tests.

https://github.com/toastdriven/django-tastypie/blob/v0.10.0/tests/validation/tests.py

If anybody has any thoughts or concerns about this, please let me know.