> if (data['firstDate'] >= data['lastDate']):
> raise ValidationError("Error")
it should read
raise forms.ValidationError
If you want to have the error not only as a non_field global error,
but actually added to the fields where the error occured, you can do
the following in
Hi Marco,
In Django 1.0, you don't need to call clean from clean, Django will do
that automatically for you. :)
So what you can do is:
def clean(self):
data = self.cleaned_data
if (data['firstDate'] >= data['lastDate']):
raise ValidationError("Error")
Sorry, i've posted without finishing the message :)
So, if I call clean(self), Django give me this exception for the
following line:
super(forms.DateField, self).clean()
Exception Type: TypeError
Exception Value:
super(type, obj): obj must be an instance or subtype of type
3 matches
Mail list logo