From ebba67c4ae9a131ba87dcd8639342d331f380556 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Mon, 6 Jun 2022 12:55:53 +0700 Subject: [PATCH] Allow customizing table class in generic IndexView --- wagtail/admin/views/generic/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wagtail/admin/views/generic/models.py b/wagtail/admin/views/generic/models.py index 17ed0146ea..ca8d6cb1c2 100644 --- a/wagtail/admin/views/generic/models.py +++ b/wagtail/admin/views/generic/models.py @@ -73,6 +73,7 @@ class IndexView( default_ordering = None is_searchable = None search_kwarg = "q" + table_class = Table def setup(self, request, *args, **kwargs): super().setup(request, *args, **kwargs) @@ -161,7 +162,7 @@ class IndexView( def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) index_url = self.get_index_url() - table = Table( + table = self.table_class( self.columns, context["object_list"], base_url=index_url,