diff --git a/fmft/formset_tables.py b/fmft/formset_tables.py
index d2e0ef3..a677f72 100644
--- a/fmft/formset_tables.py
+++ b/fmft/formset_tables.py
@@ -33,6 +33,15 @@
FormMap = Callable[[object], django.forms.Form]
+class BaseModelFormSet(django.forms.models.BaseModelFormSet):
+ """Extends BaseModelFormSet to add non-form error report suited to formsets displayed in a table"""
+ def all_non_field_errors(self):
+ error_list = self.non_form_errors().copy()
+ for form in self:
+ error_list.extend(form.non_field_errors())
+ return error_list
+
+
# Queryset: get the paged data used by a bound table
diff --git a/fmft/templates/fmft/form_non_field_errors_tr.html b/fmft/templates/fmft/form_non_field_errors_tr.html
new file mode 100644
index 0000000..06d1a97
--- /dev/null
+++ b/fmft/templates/fmft/form_non_field_errors_tr.html
@@ -0,0 +1,11 @@
+{# Render any non-field form errors as a table row #}
+{% if form.non_field_errors %}
+
+
+ {% if form_error_title %}{{ form_error_title }}{% endif %}
+
+ {{ form.non_field_errors|unordered_list }}
+
+ |
+
+{% endif %}
\ No newline at end of file
diff --git a/fmft/templates/fmft/tabular_formset.html b/fmft/templates/fmft/tabular_formset.html
index 2efa07d..5dedf38 100644
--- a/fmft/templates/fmft/tabular_formset.html
+++ b/fmft/templates/fmft/tabular_formset.html
@@ -16,6 +16,9 @@
{% for form in formset %}
+ {% if form_show_errors and not form.is_extra %}
+ {% include "fmft/form_non_field_errors_tr.html" %}
+ {% endif %}
{% for field in form %}
{% include 'fmft/form_field.html' %} |
diff --git a/fmft/views.py b/fmft/views.py
index 913b942..8104499 100644
--- a/fmft/views.py
+++ b/fmft/views.py
@@ -83,6 +83,7 @@ class BaseModelFormSetView(
):
"""A Base class that emulates formsets.ModelFormSetView, but without its request
handlers"""
+ formset_class = formset_tables.BaseModelFormSet
pass
@@ -140,6 +141,7 @@ class BaseModelFormSetSingleTableMixin(BaseFormSetFactory, tables.SingleTableMix
model = None
request = None
+ formset_class = formset_tables.BaseModelFormSet
_table = None
_formset = None