File tree Expand file tree Collapse file tree 4 files changed +28
-21
lines changed Expand file tree Collapse file tree 4 files changed +28
-21
lines changed Original file line number Diff line number Diff line change 1- version = '1.7.0 '
1+ version = '1.7.1 '
22default_app_config = 'adminlteui.apps.AdminlteUIConfig'
Original file line number Diff line number Diff line change @@ -62,16 +62,18 @@ class Media:
6262
6363 def changelist_view (self , request , extra_context = None ):
6464 view = super ().changelist_view (request , extra_context )
65- cl = view .context_data .get ('cl' )
66- cl .search_field_placeholder = self .search_field_placeholder
67- filter_specs = cl .filter_specs
68-
69- for index , filter_spec in enumerate (filter_specs ):
70- if filter_spec .field_path in self .select2_list_filter :
71- # flag to use select2
72- filter_spec .display_select2 = True
73- cl .filter_specs [index ] = filter_spec
74- view .context_data ['cl' ] = cl
65+ if hasattr (view , 'context_data' ):
66+ cl = view .context_data .get ('cl' , None )
67+ if cl :
68+ cl .search_field_placeholder = self .search_field_placeholder
69+ filter_specs = cl .filter_specs
70+
71+ for index , filter_spec in enumerate (filter_specs ):
72+ if filter_spec .field_path in self .select2_list_filter :
73+ # flag to use select2
74+ filter_spec .display_select2 = True
75+ cl .filter_specs [index ] = filter_spec
76+ view .context_data ['cl' ] = cl
7577 return view
7678
7779
Original file line number Diff line number Diff line change 11# ChangeLog
2+ ## [ v1.7.1] ( https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0 )
3+ - fix exception when delete in changelist_view
4+ - update docs
25
36## [ v1.7.0] ( https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0 )
47- make previous & next button effective on change_list.html
Original file line number Diff line number Diff line change @@ -264,17 +264,19 @@ Modify apps icon & order apps/models
264264
265265``` python
266266ADMINLTE_SETTINGS = {
267- ' example-app' : {
268- ' icon' : ' fa-desktop' ,
269- ' models' : {
270- ' example-model' : {
271- ' icon' : ' fa-archive'
272- },
273- ' example-model1' : {}
267+ ' apps' : {
268+ ' example-app' : {
269+ ' icon' : ' fa-desktop' ,
270+ ' models' : {
271+ ' example-model' : {
272+ ' icon' : ' fa-archive'
273+ },
274+ ' example-model1' : {}
275+ }
276+ },
277+ ' auth' : {
278+ ' icon' : ' fa-users'
274279 }
275- },
276- ' auth' : {
277- ' icon' : ' fa-users'
278280 }
279281}
280282```
You can’t perform that action at this time.
0 commit comments