Add docstring for NullableMultipleChoiceFilter

This commit is contained in:
Brian Tiemann 2024-09-13 09:13:58 -04:00
parent 98ba553466
commit 4f9e7db23f

View File

@ -18,6 +18,7 @@ __all__ = (
'MultiValueTimeFilter', 'MultiValueTimeFilter',
'MultiValueWWNFilter', 'MultiValueWWNFilter',
'NullableCharFieldFilter', 'NullableCharFieldFilter',
'NullableMultipleChoiceFilter',
'NumericArrayFilter', 'NumericArrayFilter',
'TreeNodeMultipleChoiceFilter', 'TreeNodeMultipleChoiceFilter',
) )
@ -144,7 +145,9 @@ class NullableCharFieldFilter(django_filters.CharFilter):
class NullableMultipleChoiceFilter(django_filters.MultipleChoiceFilter): class NullableMultipleChoiceFilter(django_filters.MultipleChoiceFilter):
"""
Similar to NullableCharFieldFilter, but allows multiple values including the special NULL string.
"""
def filter(self, qs, value): def filter(self, qs, value):
if settings.FILTERS_NULL_CHOICE_VALUE in value: if settings.FILTERS_NULL_CHOICE_VALUE in value:
value.append('') value.append('')