modlinltd / django-advanced-filters

Add advanced filtering abilities to Django admin
https://pypi.org/project/django-advanced-filters/
MIT License
771 stars 173 forks source link

Some operators should not require a value #8

Open asfaltboy opened 8 years ago

asfaltboy commented 8 years ago

The operator values isnull, istrue and isfalse should allow a null/empty value when submitting the form. To be more intuitive we should set the value field to disabled when it one of the mentioned operators is selected.

image

ianfitzpatrick commented 8 years ago

This tripped me up too. For boolean fields, like for instance is_active on the user record, equals "1" or equals "True" returned no results for me. I tried setting the operating to "is TRUE" but was getting the value field required error so was pretty confused.

It didn't occur to me to simply set the value field to null to get this filter working. A little counter intuitive for sure.

asfaltboy commented 8 years ago

I may get to this by next weekend, but any PRs (even with simple documentation clarification) are most welcome.

mrname commented 6 years ago

https://github.com/modlinltd/django-advanced-filters/pull/82

eriktelepovsky commented 2 years ago

+1