django-advanced-filters icon indicating copy to clipboard operation
django-advanced-filters copied to clipboard

Some operators should not require a value

Open asfaltboy opened this issue 9 years ago • 4 comments
trafficstars

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

asfaltboy avatar Dec 11 '15 07:12 asfaltboy

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.

ianfitzpatrick avatar Apr 13 '16 16:04 ianfitzpatrick

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

asfaltboy avatar Apr 14 '16 08:04 asfaltboy

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

mrname avatar Jun 28 '18 20:06 mrname

+1

eriktelepovsky avatar Dec 20 '21 14:12 eriktelepovsky