print("data['attachments']['start'] =", data['attachments']['start']) # 2023-10-18
formatted_start_date = data['attachments']['start']
print("formatted_start_date =",formatted_start_date) # 2023-10-18
soDict = {
'so_start_date': formatted_start_date,
'so_end_date': formatted_end_date,
}
print("soDict =", soDict)
so = ServiceOrder(**soDict)
so.save()
But I get :
django.core.exceptions.ValidationError: ['ββ value has an invalid date format. It must be in YYYY-MM-DD format.']
The model is like this :
class ServiceOrder(models.Model):
so_start_date = models.DateField(blank=True, null=True)
so_end_date = models.DateField(blank=True, null=True)