I know there are a lot of threads alredy talking about this but there is none that remotely solved my problem. This is really weird because everything has been done how it's meant to be done.
Here is my forms.py:
from django import forms
from airspress import settings
class searchForm(forms.Form):
depDate1 = forms.DateField(required=False, input_formats=settings.DATE_INPUT_FORMATS)
depDate2 = forms.DateField(required=False, input_formats=settings.DATE_INPUT_FORMATS)
cityDep = forms.CharField(required=False)
cityArr = forms.CharField(required=False)
And here is a simple test :
data = {'depDate1':'1-5-2015'}
boo = searchForm(data)
if boo.is_valid():
pass
print boo.errors
#print: <ul class='errorlist'><li>depDate1<ul><li>Enter a valid date</li></ul></li></ul>
In short i have an "Enter a valid date" error, And i've tried absolutely everything, every kind of date format i can think of, it only works when i create an actual datetime.datetime object and assign to the field value. I've done lot of testing in actual rendered html form to no avail.
Hope I'm actually missing something and i'm not just doomed for the day...
Thank you very much !