diff options
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/boundfield.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py index 9c0cd6e427..f3f6e3aea0 100644 --- a/django/forms/boundfield.py +++ b/django/forms/boundfield.py @@ -53,6 +53,10 @@ class BoundField: for widget in self.field.widget.subwidgets(self.html_name, self.value(), attrs=attrs) ) + def __bool__(self): + # BoundField evaluates to True even if it doesn't have subwidgets. + return True + def __iter__(self): return iter(self.subwidgets) |
