@@ -87,7 +87,7 @@ top menu,default is `[]`,will show nothing
8787> Tips: Top menu will not show icon,only support secondary menu max
8888
8989## ModelAdmin
90- external ModelAdmin in django
90+ ### external ModelAdmin in django
9191
9292- make table filter support ` select2 ` in ` change_list ` page
9393- custom search field placeholder for ` change_list ` page
@@ -109,6 +109,24 @@ effect
109109
110110![ modeladmin] ( ../assets/images/modeladmin.png )
111111
112+ ### Custom Filters
113+ #### DateRangeFilter
114+
115+ example:
116+ ``` python title='rap/admin.py'
117+ from adminlteui.admin import ModelAdmin
118+ from adminlteui.filters import DateRangeFilter
119+
120+ class AutomationTaskRecordAdmin (CommonAdmin , ModelAdmin ):
121+ list_display = (' id' , ' automation' , ' account' , ' status' , ' start_time' ,
122+ ' end_time' , ' update_time' )
123+ list_filter = (' automation__project' , ' automation__source' ,
124+ ' status' , (' start_time' , DateRangeFilter), (' end_time' , DateRangeFilter))
125+
126+ ```
127+ effect:
128+ ![ adminlte_date_range_filter] ( ../assets/images/adminlte_date_range_filter.png )
129+
112130## Widgets
113131
114132### AdminlteSelect
@@ -146,4 +164,4 @@ class CollectorAdmin(admin.ModelAdmin):
146164```
147165effect:
148166
149- ![ adminlte_select ] ( ../assets/images/adminlte_select_multiple.png )
167+ ![ adminlte_select_multiple ] ( ../assets/images/adminlte_select_multiple.png )
0 commit comments