1👍
✅
Yes, it is possible for a field to have more than one error. For example, you can use the add_error
method to add multiple errors to the same field:
class MyForm(forms.Form):
field1 = forms.CharField()
def clean(self):
self.add_error('field1', 'error1')
self.add_error('field1', 'error2')
0👍
It is possible to have multiple errors per field, you can instantiate ValidationError
and add it to a particular field in the form’s clean()
method via Form.add_error()
here.
- Django: cretae new object with unique order
- How to make Postgresql query with JQuery in Django?
- Django ImageField not deleted if default is set
- Append does not work in For Loop
Source:stackexchange.com