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
from django.contrib.admin import FieldListFilter | |
from django.utils.translation import ugettext as _ | |
class ActiveValueFilter(FieldListFilter): | |
"""list_filter which displays only the values for a field which are in use | |
This is handy when a large range has been filtered in some way which means | |
most of the potential values aren't currently in use. This requires a | |
queryset field or annotation named "item_count" to be present so it can |