Repository: django-import-export/django-import-export

Issue:
ImportExportMixin overlaps change_list_template property making it not compatible with other mixins
**Describe the bug**
If I combine `ImportExportMixin` with `SortableAdminMixin` from `django-admin-sortable2` I can't get both functionalities to work together.
I have already described the issue and made PR for `django-admin-sortable2`: https://github.com/jrief/django-admin-sortable2/issues/316
That fixes the issue combined usage of mixins from these two applications, but the same issue is present in `django-admin-sortable2` as well and could raise problems when combining with other applications (or if user sets up different `change_list_template` parameter).

The same principle to fix this should be used also for `django-import-export`. Setting of the `change_list_template` parameters in `ImportMixin`, `ExportMixin`, `ImportExportMixin` should be moved to `__init__`, the original value should be stored and used in `{% extends %}` tag of the `admin/change_list.html` template.

**Versions (please complete the following information):**
 - Django Import Export: 4.0.2
 - Python 3.10
 - Django 4.0




Discussion:
Wanted to say thanks for this info, used it to resolve a similar problem. Likely something we ought to fix in the main code!
I've submitted a [PR](https://github.com/django-import-export/django-import-export/pull/1483) I think addresses this problem. I ran into this in combination with the reversion library, not django-admin-sortable2, but the underlying issue is the same.

Resolving patch:
diff --git a/import_export/admin.py b/import_export/admin.py
--- a/import_export/admin.py
+++ b/import_export/admin.py
@@ -33,10 +33,34 @@
 
 
 class ImportExportMixinBase:
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+
+        # Store already set change_list_template to allow users to independently
+        # customize the change list object tools. This treats the cases where
+        # `self.change_list_template` is `None` (the default in `ModelAdmin`) or
+        # where `self.import_export_change_list_template` is `None` as falling
+        # back on the default templates.
+        if getattr(self, 'change_list_template', None):
+            self.base_change_list_template = self.change_list_template
+        else:
+            self.base_change_list_template = 'admin/change_list.html'
+
+        self.change_list_template = getattr(
+            self, 'import_export_change_list_template', None
+        )
+        if self.change_list_template is None:
+            self.change_list_template = self.base_change_list_template
+
     def get_model_info(self):
         app_label = self.model._meta.app_label
         return (app_label, self.model._meta.model_name)
 
+    def changelist_view(self, request, extra_context=None):
+        extra_context = extra_context or {}
+        extra_context['base_change_list_template'] = self.base_change_list_template
+        return super().changelist_view(request, extra_context)
+
 
 class ImportMixin(BaseImportMixin, ImportExportMixinBase):
     """
@@ -47,7 +71,7 @@ class ImportMixin(BaseImportMixin, ImportExportMixinBase):
     """
 
     #: template for change_list view
-    change_list_template = 'admin/import_export/change_list_import.html'
+    import_export_change_list_template = 'admin/import_export/change_list_import.html'
     #: template for import view
     import_template_name = 'admin/import_export/import.html'
     #: available import formats
@@ -547,7 +571,7 @@ class ExportMixin(BaseExportMixin, ImportExportMixinBase):
     https://docs.djangoproject.com/en/dev/ref/contrib/admin/
     """
     #: template for change_list view
-    change_list_template = 'admin/import_export/change_list_export.html'
+    import_export_change_list_template = 'admin/import_export/change_list_export.html'
     #: template for export view
     export_template_name = 'admin/import_export/export.html'
     #: export data encoding
@@ -709,7 +733,7 @@ class ImportExportMixin(ImportMixin, ExportMixin):
     Import and export mixin.
     """
     #: template for change_list view
-    change_list_template = 'admin/import_export/change_list_import_export.html'
+    import_export_change_list_template = 'admin/import_export/change_list_import_export.html'
 
 
 class ImportExportModelAdmin(ImportExportMixin, admin.ModelAdmin):
@@ -724,7 +748,7 @@ class ExportActionMixin(ExportMixin):
     """
 
     # Don't use custom change list template.
-    change_list_template = None
+    import_export_change_list_template = None
 
     def __init__(self, *args, **kwargs):
         """


Test patch:
diff --git a/tests/core/admin.py b/tests/core/admin.py
--- a/tests/core/admin.py
+++ b/tests/core/admin.py
@@ -32,6 +32,7 @@ class BookAdmin(ImportExportMixin, admin.ModelAdmin):
     list_display = ('name', 'author', 'added')
     list_filter = ['categories', 'author']
     resource_classes = [BookResource, BookNameResource]
+    change_list_template = "core/admin/change_list.html"
 
 
 class CategoryAdmin(ExportActionModelAdmin):
diff --git a/tests/core/templates/core/admin/change_list.html b/tests/core/templates/core/admin/change_list.html
new file mode 100644
--- /dev/null
+++ b/tests/core/templates/core/admin/change_list.html
@@ -0,0 +1,9 @@
+{% extends "admin/change_list.html" %}
+{% comment %}
+A template used for testing customizations to the change_list view (See #1483).
+{% endcomment %}
+
+{% block object-tools-items %}
+  <!-- <li>Custom change list item</li> -->
+  {{ block.super }}
+{% endblock %}
diff --git a/tests/core/tests/test_admin_integration.py b/tests/core/tests/test_admin_integration.py
--- a/tests/core/tests/test_admin_integration.py
+++ b/tests/core/tests/test_admin_integration.py
@@ -53,8 +53,11 @@ def test_import_export_template(self):
         self.assertEqual(response.status_code, 200)
         self.assertTemplateUsed(response,
                 'admin/import_export/change_list_import_export.html')
+        self.assertTemplateUsed(response, 'admin/change_list.html')
+        self.assertTemplateUsed(response, 'core/admin/change_list.html')
         self.assertContains(response, _('Import'))
         self.assertContains(response, _('Export'))
+        self.assertContains(response, 'Custom change list item')
 
     @override_settings(TEMPLATE_STRING_IF_INVALID='INVALID_VARIABLE')
     def test_import(self):