I got it working. It was my ignorance. I had to redefine lookup_type
in forms.py
instead. Like this:
lookup_type = forms.ChoiceField(choices=LOOKUP_TYPE_CHOICES)
and not:
lookup_type = django_filters.ChoiceFilter(choices=LOOKUP_TYPE_CHOICES)
Because what django-filter was doing, it was trying to filter the lookup_type
field, which does not exist in my models. It was throwing an error FieldError at/. Cannot resolve keyword 'lookup_type' into field
, which I did not know about because another app I am using - django_tables2 modified this error to something else, which tricked me successfully.
It's probably a useless thread now but I just want to let pleople who tried to solve this, know.