@@ -110,7 +110,22 @@ Your `validate_<fieldname>` methods should either just return the `attrs` dictio
...
@@ -110,7 +110,22 @@ Your `validate_<fieldname>` methods should either just return the `attrs` dictio
### Object-level validation
### Object-level validation
To do any other validation that requires access to multiple fields, add a method called `.validate()` to your `Serializer` subclass. This method takes a single argument, which is the `attrs` dictionary. It should raise a `ValidationError` if necessary, or just return `attrs`.
To do any other validation that requires access to multiple fields, add a method called `.validate()` to your `Serializer` subclass. This method takes a single argument, which is the `attrs` dictionary. It should raise a `ValidationError` if necessary, or just return `attrs`. For example: