docs: fix code example (#8880)

This commit is contained in:
Özgür 2023-02-16 01:48:34 -05:00 committed by GitHub
parent 4abfa28e08
commit 34953774f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,7 +226,7 @@ Individual fields on a serializer can include validators, by declaring them on t
raise serializers.ValidationError('Not a multiple of ten') raise serializers.ValidationError('Not a multiple of ten')
class GameRecord(serializers.Serializer): class GameRecord(serializers.Serializer):
score = IntegerField(validators=[multiple_of_ten]) score = serializers.IntegerField(validators=[multiple_of_ten])
... ...
Serializer classes can also include reusable validators that are applied to the complete set of field data. These validators are included by declaring them on an inner `Meta` class, like so: Serializer classes can also include reusable validators that are applied to the complete set of field data. These validators are included by declaring them on an inner `Meta` class, like so: