From e80d3d1bdfb071a288340555cb6fe8a9bce3772d Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Sun, 17 Mar 2013 19:51:04 +0000 Subject: [PATCH] Fix text regarding serializer error messages. Closes #734. --- docs/api-guide/serializers.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index de2cf7d8f..e7e1670b2 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