Django: Overriding the clean() method in forms - question about raising errors -
I'm talking in a clear way like this:
Cleaned_data ['type']. Organized_by! = Self.cleaned_data ['organized_by']: forms.ValidationError ('type and organization do not match.') If self.cleaned_data ['start'] & gt; Self.cleaned_data ['end']: forms.ValidationError ('The start date can not be more than the end date.')
But then it means that the form only increases one Can one of these errors be formulated to increase these two errors at a time?
Edit # 1 : Any solution above is great, but there will be anything that looks like a scenario:
Self.cleaned_data ['type'] Organized_by! = Self.cleaned_data ['organized_by']: forms.ValidationError ('type and organization do not match.') If self.cleaned_data ['start'] & gt; Self.cleaned_data ['end']: forms.ValidationError ('Start Date can not be more than the end date.') Super (FooForm, Self). Skin ()
Where FooAddForm is a model form and there are unique obstacles in it which can also cause errors. If anyone knows something like this, then it would be great ...
From Docs:
Comments
Post a Comment