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

Negate not been respected #132

Open instasck opened 3 years ago

instasck commented 3 years ago

Describe the bug I have a "follower" object, with many to many language field have "he" and "ar". I choose "he" and not "ar": image

But I did find Arabic (ar) in the results: image

and checked that this user have "ar": image

DEBUG LOG: DEBUG {'children': [['languagecode_nameiexact', 'he'], <Q: (NOT (AND: ['languagecode_nameiexact', 'ar']))>, ['gender__iexact', 'female']], 'connector': 'AND', 'negated': False}

So why he shows up in results ?

Details (please complete the following information):

instasck commented 3 years ago

image

So once the NEGATE condition is first it will work. Once I do like this: image

It will not work.