diff --git a/README.md b/README.md
index 2327f565e..2eac09c1f 100644
--- a/README.md
+++ b/README.md
@@ -839,11 +839,12 @@ Adding support for django-guardian is quote straightforward in Unfold, just add
from unfold.admin import ModelAdmin
from import_export.admin import ImportExportModelAdmin
-from unfold.contrib.import_export.forms import ExportForm, ImportForm
+from unfold.contrib.import_export.forms import ExportForm, ImportForm, SelectableFieldsExportForm
class ExampleAdmin(ModelAdmin, ImportExportModelAdmin):
import_form_class = ImportForm
export_form_class = ExportForm
+ # export_form_class = SelectableFieldsExportForm
```
When implementing `import_export.admin.ExportActionModelAdmin` class in admin panel, import_export plugin adds its own implementation of action form which is not incorporating Unfold CSS classes. For this reason, `unfold.contrib.import_export.admin` contains class with the same name `ExportActionModelAdmin` which inherits behavior of parent form and adds appropriate CSS classes.
diff --git a/src/unfold/contrib/import_export/forms.py b/src/unfold/contrib/import_export/forms.py
index c577ca326..b6ac9101f 100644
--- a/src/unfold/contrib/import_export/forms.py
+++ b/src/unfold/contrib/import_export/forms.py
@@ -1,6 +1,14 @@
+from django.forms.fields import BooleanField
from import_export.forms import ExportForm as BaseExportForm
from import_export.forms import ImportForm as BaseImportForm
-from unfold.widgets import SELECT_CLASSES, UnfoldAdminFileFieldWidget
+from import_export.forms import (
+ SelectableFieldsExportForm as BaseSelectableFieldsExportForm,
+)
+from unfold.widgets import (
+ SELECT_CLASSES,
+ UnfoldAdminFileFieldWidget,
+ UnfoldBooleanWidget,
+)
class ImportForm(BaseImportForm):
@@ -17,3 +25,14 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["resource"].widget.attrs["class"] = " ".join(SELECT_CLASSES)
self.fields["format"].widget.attrs["class"] = " ".join(SELECT_CLASSES)
+
+
+class SelectableFieldsExportForm(BaseSelectableFieldsExportForm):
+ def __init__(self, formats, resources, **kwargs):
+ super().__init__(formats, resources, **kwargs)
+ self.fields["resource"].widget.attrs["class"] = " ".join(SELECT_CLASSES)
+ self.fields["format"].widget.attrs["class"] = " ".join(SELECT_CLASSES)
+
+ for _key, field in self.fields.items():
+ if isinstance(field, BooleanField):
+ field.widget = UnfoldBooleanWidget()
diff --git a/src/unfold/contrib/import_export/templates/admin/import_export/export.html b/src/unfold/contrib/import_export/templates/admin/import_export/export.html
index 6b5d77aa0..1aafd62c0 100644
--- a/src/unfold/contrib/import_export/templates/admin/import_export/export.html
+++ b/src/unfold/contrib/import_export/templates/admin/import_export/export.html
@@ -50,15 +50,29 @@
{% include "admin/import_export/resource_fields_list.html" with import_or_export="export" %}
{% endif %}
+ {{ form.non_field_errors }}
+