1 2 3 4 5 | class MyForm(forms.Form):
def get_global_errors(self):
errors = dict(self.errors)
return list(errors.get("__all__", []))
|
More like this
- AjaxForm Base Classes by btaylordesign 1 year, 2 months ago
- Tamper safe HiddenFields by alexmeisel 3 years, 6 months ago
- Querying on existence of a relationship by ubernostrum 4 years, 9 months ago
- ReCaptcha for django forms (improved and with remoteip) by pinkeen 1 year, 5 months ago
- Model Locking Mixin & Decorator (MySQL Advisory Locks) by pio 1 year ago
Comments
def get_global_errors(self): return self.errors and self.errors.get('_all_',[])
#
I am not sure about the situation at the time of writing this post, but global errors can be accessed by
{{ form.non_field_errors }}#