mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +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 = [
|
||||||
queryset=Event.objects.all(),
|
UniqueTogetherValidator(
|
||||||
fields=['room_number', 'date']
|
queryset=Event.objects.all(),
|
||||||
)
|
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