Removed explicit checks against QueryField and [Null]BooleanField

I did add them to FORM_FIELD_LOOKUPS, though, to underscore that they
were considered and are intentially empty for future devs.
This commit is contained in:
Jason Novinger 2025-11-24 15:35:24 -06:00
parent 860bdae1e9
commit edbcea817c

View File

@ -21,6 +21,9 @@ __all__ = (
# Mapping of form field types to their supported lookups
FORM_FIELD_LOOKUPS = {
QueryField: [],
forms.BooleanField: [],
forms.NullBooleanField: [],
forms.CharField: [
('exact', _('Is')),
('n', _('Is Not')),
@ -204,12 +207,6 @@ class FilterModifierMixin:
Returns an empty list for fields that should not be enhanced.
"""
if isinstance(field, QueryField):
return []
if isinstance(field, (forms.BooleanField, forms.NullBooleanField)):
return []
for field_class in field.__class__.__mro__:
if field_class in FORM_FIELD_LOOKUPS:
return FORM_FIELD_LOOKUPS[field_class]