mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Fix serializer example in docs (#7233)
This commit is contained in:
parent
86aa549832
commit
be96939ec1
|
@ -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).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user