2đź‘Ť
âś…
There is a bug where AllValuesFilter
does not have an all/any option. #680 should fix the issue, but it’s currently unmerged. In the meantime, you should be able to install the related branch for the PR, or create a custom subclass that adds the “All” option. Something like:
class ActuallyAllValuesFilter(django_filters.AllValuesFilter):
@property
def field(self):
f = super(ActuallyAllValuesFilter, self).field
f.choices = [('', 'All')] + f.choices
return f
👤Sherpa
Source:stackexchange.com