* ui_ux: => 0
* type: => Uncategorized
* severity: => Normal
* easy: => 0
Comment:
I agree, I just fixed my problem by adding
{{{#!python
def clean(self):
cleaned_data = super(MyForm, self).clean()
if not cleaned_data['my_date']:
cleaned_data['my_date'] = None
return cleaned_data
}}}
to my form. Without this I received the error
{{{#!python
ValidationError: [u"'' value has an invalid date format. It must be in
YYYY-MM-DD format."]
}}}
even though I had blank=True, null=True set in my model and required=False
set in my form.
--
Ticket URL: <https://code.djangoproject.com/ticket/11765#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by yekibud):
I got this error using crispy-forms and not specifying my Date field in
Meta.fields. Adding a clean()n method didn't help but adding the Date
field back to Meta.fields did.
--
Ticket URL: <https://code.djangoproject.com/ticket/11765#comment:8>
Comment (by htelsiz):
same thing happened to me
--
Ticket URL: <https://code.djangoproject.com/ticket/11765#comment:9>