Created
August 3, 2021 04:12
-
-
Save daimon99/a444a7bca4b993367a9f422de657f90c to your computer and use it in GitHub Desktop.
#django #admin #filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list_filter = [ | |
('id', RangeNumericFilter), | |
AutocompleteFilterFactory('摄像头', 'cam_algo__cam'), | |
AutocompleteFilterFactory('算法', 'cam_algo__algo'), | |
AutocompleteFilterFactory('通道加载算法', 'cam_algo'), | |
'source_type', | |
('created', DateRangeFilter), | |
] | |
class OuFilter(AutocompleteFilter): | |
title = '组织' # display title | |
field_name = 'ou' # name of the foreign key field | |
list_filter = [OuFilter, UserFilter] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment