kopia lustrzana https://github.com/wagtail/wagtail
Filter PageListingMixin.columns by name instead of using pop() by index
rodzic
b1a1989899
commit
d8bdc900c8
wagtail/admin/views/pages
|
@ -288,9 +288,7 @@ class IndexView(PageListingMixin, generic.IndexView):
|
|||
|
||||
@classproperty
|
||||
def columns(cls):
|
||||
columns = PageListingMixin.columns.copy()
|
||||
columns.pop(4) # Remove the "Type" column
|
||||
return columns
|
||||
return [col for col in PageListingMixin.columns if col.name != "type"]
|
||||
|
||||
def get_base_queryset(self):
|
||||
pages = self.model.objects.filter(depth__gt=1)
|
||||
|
@ -313,8 +311,7 @@ class ExplorableIndexView(IndexView):
|
|||
|
||||
@classproperty
|
||||
def columns(cls):
|
||||
columns = PageListingMixin.columns.copy()
|
||||
columns.pop(2) # Remove the "Parent" column
|
||||
columns = [col for col in PageListingMixin.columns if col.name != "parent"]
|
||||
columns.append(NavigateToChildrenColumn("navigate", width="10%"))
|
||||
return columns
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class SearchView(PageListingMixin, PermissionCheckedMixin, BaseListingView):
|
|||
|
||||
@classproperty
|
||||
def columns(cls):
|
||||
columns = super().columns.copy()
|
||||
columns = PageListingMixin.columns.copy()
|
||||
columns.append(NavigateToChildrenColumn("navigate", width="10%"))
|
||||
return columns
|
||||
|
||||
|
|
|
@ -29,9 +29,7 @@ class ContentTypeUseView(PageListingMixin, PermissionCheckedMixin, BaseListingVi
|
|||
|
||||
@classproperty
|
||||
def columns(cls):
|
||||
columns = PageListingMixin.columns.copy()
|
||||
columns.pop(4) # Remove the "Type" column
|
||||
return columns
|
||||
return [col for col in PageListingMixin.columns if col.name != "type"]
|
||||
|
||||
def get(self, request, *, content_type_app_name, content_type_model_name):
|
||||
try:
|
||||
|
|
Ładowanie…
Reference in New Issue