0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00

Allow customizing table class in generic IndexView

This commit is contained in:
Sage Abdullah 2022-06-06 12:55:53 +07:00 committed by Karl Hobley
parent 1daae922b2
commit ebba67c4ae

View File

@ -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,