You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-guide/serializers.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ When deserializing data, you always need to call `is_valid()` before attempting
152
152
serializer.is_valid()
153
153
# False
154
154
serializer.errors
155
-
# {'email': [u'Enter a valid e-mail address.'], 'created': [u'This field is required.']}
155
+
# {'email': ['Enter a valid e-mail address.'], 'created': ['This field is required.']}
156
156
157
157
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. The name of the `non_field_errors` key may be customized using the `NON_FIELD_ERRORS_KEY` REST framework setting.
158
158
@@ -253,7 +253,7 @@ When passing data to a serializer instance, the unmodified data will be made ava
253
253
By default, serializers must be passed values for all required fields or they will raise validation errors. You can use the `partial` argument in order to allow partial updates.
The context dictionary can be used within any serializer field logic, such as a custom `.to_representation()` method, by accessing the `self.context` attribute.
421
421
@@ -1094,10 +1094,10 @@ This would then allow you to do the following:
0 commit comments