Answer the question
In order to leave comments, you need to log in
Datefield field validation in DRF?
I can not understand why it does not accept an empty value for the field DateField
models.py
class Vendors(models.Model):
...
nda = models.DateField(blank=True, null=True)
{
"vendor_name": "The Greey sAlsbudm2",
"country": "Belarus",
"nda": "2020-12-23",
"contacts": [{"contact_name": "Mrk", "phone": "2373823", "email": "[email protected]"},
{
"contact_name": "Uio",
"phone": "34567",
"email": "[email protected]"
}
]
}
{
"vendor_name": "The Greey sAlsbudm2",
"country": "Belarus",
"nda": "",
...
}
{
"nda": [
"Date has wrong format. Use one of these formats instead: YYYY-MM-DD."
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question