As you can see from the screenshot bellow, When using and customizing django admin filters like so:
class DealExpiredListFilter(admin.SimpleListFilter):
title = 'expired'
parameter_name = 'expired'
def lookups(self, request, model_admin):
return (
('yes', 'yes'),
('no', 'no'),
)
def queryset(self, request, queryset):
if self.value() == "yes":
return queryset.filter(end_date__lt=timezone.now())
elif self.value() == "no":
return queryset.exclude(end_date__lt=timezone.now())
Django will insert an "All" option at any case (which is great for %99 of the times). I want to rename or remove that "All" option as can bee seen in the screenshot
