Django admin custom filter
class NullFilter(admin.SimpleListFilter) : parameter_name = 'title' title = 'title' def lookups(self, request, model_admin) : return ( ('Not Null', 'Not empty only'), ('Null', 'Empty only'), ) def queryset(self, request, queryset) : title= self.value() if title== 'Not Null' : return queryset.filter(category__isnull=False) elif title== 'Null' : return queryset.filter(category__isnull=True) return..
2020.12.30