Fix serializer example in docs (#7233)

This commit is contained in:
0dysseas 2020-03-17 18:49:19 +02:00 committed by GitHub
parent 86aa549832
commit be96939ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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