mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-03 15:04:08 +03:00
Removed extra <> in validators example (#9590)
Co-authored-by: Aman Sharma <210100011@iitb.ac.in>
This commit is contained in:
parent
b31413d46d
commit
dbac145638
|
@ -48,7 +48,7 @@ If we open up the Django shell using `manage.py shell` we can now
|
|||
CustomerReportSerializer():
|
||||
id = IntegerField(label='ID', read_only=True)
|
||||
time_raised = DateTimeField(read_only=True)
|
||||
reference = CharField(max_length=20, validators=[<UniqueValidator(queryset=CustomerReportRecord.objects.all())>])
|
||||
reference = CharField(max_length=20, validators=[UniqueValidator(queryset=CustomerReportRecord.objects.all())])
|
||||
description = CharField(style={'type': 'textarea'})
|
||||
|
||||
The interesting bit here is the `reference` field. We can see that the uniqueness constraint is being explicitly enforced by a validator on the serializer field.
|
||||
|
|
Loading…
Reference in New Issue
Block a user