File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 2020from unfold .mixins import ActionModelAdminMixin , BaseModelAdminMixin
2121from unfold .overrides import FORMFIELD_OVERRIDES_INLINE
2222from unfold .typing import FieldsetsType
23+ from unfold .views import ChangeList
2324from unfold .widgets import UnfoldBooleanWidget
2425
2526checkbox = UnfoldBooleanWidget (
@@ -168,6 +169,9 @@ def response_add(
168169 return redirect (request .GET ["next" ])
169170 return res
170171
172+ def get_changelist (self , request , ** kwargs ):
173+ return ChangeList
174+
171175
172176class TabularInline (BaseModelAdminMixin , BaseTabularInline ):
173177 formfield_overrides = FORMFIELD_OVERRIDES_INLINE
Original file line number Diff line number Diff line change 11from typing import Any
22
3+ import django
4+ from django .contrib .admin .views .main import ERROR_FLAG , PAGE_VAR
5+ from django .contrib .admin .views .main import ChangeList as BaseChangeList
36from django .contrib .auth .mixins import PermissionRequiredMixin
47
5- from .exceptions import UnfoldException
8+ from unfold .exceptions import UnfoldException
9+
10+
11+ class ChangeList (BaseChangeList ):
12+ def __init__ (self , request , * args , ** kwargs ):
13+ super ().__init__ (request , * args , ** kwargs )
14+
15+ if django .VERSION < (5 , 0 ):
16+ self .filter_params = dict (request .GET .lists ())
17+ self .filter_params .pop (PAGE_VAR , None )
18+ self .filter_params .pop (ERROR_FLAG , None )
619
720
821class UnfoldModelAdminViewMixin (PermissionRequiredMixin ):
You can’t perform that action at this time.
0 commit comments