Fix wrong validator example in the serializers docs

This commit is contained in:
0dysseas 2020-03-17 12:01:04 +02:00
parent 86aa549832
commit 4bc66183fd

View File

@ -238,10 +238,12 @@ Serializer classes can also include reusable validators that are applied to the
class Meta:
# Each room only has one event per day.
validators = UniqueTogetherValidator(
queryset=Event.objects.all(),
fields=['room_number', 'date']
)
validators = [
UniqueTogetherValidator(
queryset=Event.objects.all(),
fields=['room_number', 'date']
)
]
For more information see the [validators documentation](validators.md).