admin: implement search for all views

see #253
This commit is contained in:
Jens Langhammer
2020-10-03 19:32:01 +02:00
parent 0150a5c58c
commit b0602a3215
28 changed files with 275 additions and 31 deletions

View File

@ -22,6 +22,7 @@ from passbook.admin.views.utils import (
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView,
SearchListMixin,
UserPaginateListMixin,
)
from passbook.policies.models import Policy, PolicyBinding
@ -29,7 +30,11 @@ from passbook.policies.process import PolicyProcess, PolicyRequest
class PolicyListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
LoginRequiredMixin,
PermissionListMixin,
UserPaginateListMixin,
SearchListMixin,
InheritanceListView,
):
"""Show list of all policies"""
@ -37,6 +42,7 @@ class PolicyListView(
permission_required = "passbook_policies.view_policy"
ordering = "name"
template_name = "administration/policy/list.html"
search_fields = ["name"]
class PolicyCreateView(