aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/serializers.md
diff options
context:
space:
mode:
authorIan Dash2013-03-07 17:29:25 +0000
committerIan Dash2013-03-08 15:08:05 +0000
commit66605acaf02d46eb899f495137afb4f9ff127ff0 (patch)
tree24d99bece5278d81cd58fb038528907611f30241 /docs/api-guide/serializers.md
parent4e80541824bab0712a816716c5c63ec5623370d8 (diff)
downloaddjango-rest-framework-66605acaf02d46eb899f495137afb4f9ff127ff0.tar.bz2
Errors during deserializing lists now return a list of tuples with
index of bad item in data plus usual errors dict
Diffstat (limited to 'docs/api-guide/serializers.md')
-rw-r--r--docs/api-guide/serializers.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index 6f1f2883..de2cf7d8 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -93,6 +93,8 @@ To serialize a queryset instead of an object instance, you should pass the `many
When deserializing data, you always need to call `is_valid()` before attempting to access the deserialized object. If any validation errors occur, the `.errors` and `.non_field_errors` properties will contain the resulting error messages.
+When deserialising a list of items, errors will be returned as a list of tuples. The first item in an error tuple will be the index of the item with the error in the original data; The second item in the tuple will be a dict with the individual errors for that item.
+
### Field-level validation
You can specify custom field-level validation by adding `.validate_<fieldname>` methods to your `Serializer` subclass. These are analagous to `.clean_<fieldname>` methods on Django forms, but accept slightly different arguments.