I've been googling for an explanation but nothing's come up. 

See
https://github.com/django/django/blob/master/django/forms/fields.py#L447

If you use a `DateField` in your form, don't you expect it to produce a 
`datetime.date` instance?
E.g.

class MyForm:
    start = forms.DateField()

    def clean_start(self):
         if self.cleaned_data['start'] > datetime.date.today():
            raise ValidationError('too futuristic')
         return self.cleaned_data['start']

This won't work! You'll get a TypeError if you run that code. 
Why is that?

It'd be easy to fix but because it's so blatant I just suspect I missed 
something obvious. 


Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a5ddd8ee-b72e-46c8-9d3c-c211aa76fa25%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to