We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f43712 commit 0b93040Copy full SHA for 0b93040
docs/api-guide/validators.md
@@ -272,6 +272,12 @@ A validator may be any callable that raises a `serializers.ValidationError` on f
272
if value % 2 != 0:
273
raise serializers.ValidationError('This field must be an even number.')
274
275
+#### Field-level validation
276
+
277
+You can specify custom field-level validation by adding `.validate_<field_name>` methods
278
+to your `Serializer` subclass. This is documented in the
279
+[Serializer docs](http://www.django-rest-framework.org/api-guide/serializers/#field-level-validation)
280
281
## Class-based
282
283
To write a class-based validator, use the `__call__` method. Class-based validators are useful as they allow you to parameterize and reuse behavior.
0 commit comments