django-filter field name greater than 1

django-filter field name greater than

class ProductFilter(django_filters.FilterSet):
    price__gt = django_filters.NumberFilter()

Here is what the above code is Doing:
1. We’re importing the django_filters module.
2. We’re creating a new class called ProductFilter.
3. We’re telling Django that ProductFilter is a subclass of django_filters.FilterSet.
4. We’re creating a new filter called price__gt.
5. We’re telling Django that price__gt is a subclass of django_filters.NumberFilter.

Similar Posts