Hi all,
I've some difficulties in a custom clean function in the following
form:

class SelectDateForm(forms.Form):
    firstDate = forms.DateField(widget=AdminDateWidget)
    lastDate = forms.DateField(widget=AdminDateWidget)

'cause I want to check if firstDate is minor than lastDate (and
obviously the format of input),
I've defined a custom validation like this:

def clean(self):
        super(forms.DateField, self).clean()

        data =  self.cleaned_data

if (data['firstDate'] >= data['lastDate']):
            raise ValidationError("Error")

        # else
        return data

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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