tomchristie/django-rest-framework — pull request #1309 by lukaszb (2013-12-20 16:53:55+00:00)
Title: Should it be that way?

I've just stumbled on this one. I wanted to make the test more explicit (e.g. validation could fail from other reason, like global serializator validation) but was surprised with the errors output.

My intuition was that if I created a field with `foobar` name that is sourcing from/to underlying model's field with another name, error messages would correspond to my serializer `foobar` field name (not `source` value, which in this case is a name of model's field). That's not the case.

This is due to https://github.com/lukaszb/django-rest-framework/blob/02ae1682b5585581e88bbd996f7cb7fd22b146f7/rest_framework/fields.py#L358, however in order for this behaviour to be changed, we would need to do a lot more work.

Is my intuition simply wrong or we have a bug here? Also, if this is intended, feel free to close this but we would need a clarification at documentation (couldn't find anything related).