mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 11:04:02 +03:00
docs: fix code example (#8880)
This commit is contained in:
parent
4abfa28e08
commit
34953774f3
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user