aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/serializers.md
diff options
context:
space:
mode:
authorTom Christie2013-03-17 19:51:04 +0000
committerTom Christie2013-03-17 19:51:04 +0000
commite80d3d1bdfb071a288340555cb6fe8a9bce3772d (patch)
tree886abfe976e03f60140fdc6def2b9ac6d1ee4d24 /docs/api-guide/serializers.md
parent22a389d0ba4dd5ac7b4fa3839491ec2708bbe7df (diff)
downloaddjango-rest-framework-e80d3d1bdfb071a288340555cb6fe8a9bce3772d.tar.bz2
Fix text regarding serializer error messages.
Closes #734.
Diffstat (limited to 'docs/api-guide/serializers.md')
-rw-r--r--docs/api-guide/serializers.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index de2cf7d8..e7e1670b 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -91,9 +91,10 @@ To serialize a queryset instead of an object instance, you should pass the `many
## Validation
-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 deserializing data, you always need to call `is_valid()` before attempting to access the deserialized object. If any validation errors occur, the `.errors` property will contain a dictionary representing the resulting error messages.
+Each key in the dictionary will be the field name, and the values will be lists of strings of any error messages corresponding to that field. The `non_field_errors` key may also be present, and will list any general validation errors.
-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.
+When deserializing a list of items, errors will be returned as a list of dictionaries representing each of the deserialized items.
### Field-level validation