I have:

DATE_INPUT_FORMATS = (
    '%n/%j/%Y', '%n/%j/%y',  # '10/25/2006', '10/25/06'
    '%n-%j-%Y', '%n-%j-%y',  # '10-25-2006', '10-25-06'
    '%M %j %Y', '%M %j, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
    '%b %j %Y', '%b %j, %Y', # 'oct 25 2006', 'oct 25, 2006'
    '%F %j %Y', '%F %j, %Y', # 'October 25 2006', 'October 25, 2006'
)


class CandidateProfileForm(forms.ModelForm):
        class Meta:
                model = Person
                dob = forms.DateField(input_formats=DATE_INPUT_FORMATS)


But I'm not getting my date format through. For example, 4-20-1990
fails, even though I think it should be covered by %n-%j-%Y

I've also tried:
class CandidateProfileForm(forms.ModelForm):
        class Meta:
                model = Person
                widgets = {
                    'dob':
forms.DateField(input_formats=DATE_INPUT_FORMATS),
        }

with no luck. What am I missing here?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to