diff options
| author | Tom Christie | 2014-10-10 14:32:02 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-10-10 14:32:02 +0100 | 
| commit | d8a8987ab1eb6abbaee1a0de8cfea38eafe21293 (patch) | |
| tree | fe68ab44986dd79a2af275b25ac2cf3c157fa7c9 /docs | |
| parent | d9a199ca0ddf92f999aa37b396596d0e3e0a26d9 (diff) | |
| download | django-rest-framework-d8a8987ab1eb6abbaee1a0de8cfea38eafe21293.tar.bz2 | |
Tweaks
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/3.0-announcement.md | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/docs/topics/3.0-announcement.md b/docs/topics/3.0-announcement.md index b28670cf..aa0e0c7e 100644 --- a/docs/topics/3.0-announcement.md +++ b/docs/topics/3.0-announcement.md @@ -144,6 +144,12 @@ The corresponding code would now look like this:          logging.info('Creating ticket "%s"' % name)          serializer.save(user=request.user)  # Include the user when saving. +#### Use `rest_framework.exceptions.ValidationFailed`. + +Django's `ValidationError` class is intended for use with HTML forms and it's API makes its use slightly awkward with nested validation errors as can occur in serializers. + +We now include a simpler `ValidationFailed` exception class in REST framework that you should use when raising validation failures. +  #### Change to `validate_<field_name>`.  The `validate_<field_name>` method hooks that can be attached to serializer classes change their signature slightly and return type. Previously these would take a dictionary of all incoming data, and a key representing the field name, and would return a dictionary including the validated data for that field: | 
