Skip to content

NumericRangeFilter does not work #363

Open
@hwalinga

Description

@hwalinga
class MyModel(models.Model):
    region = IntegerRangeField

class MyModelFilter(filters.FilterSet):
    class Meta:
        model = MyModel
        fields = "__all__"
        filter_overrides = {
            IntegerRangeField: {"filter_class": filters.NumericRangeFilter}
        } 

MyModelFilter({"region_min": 50, "region_max": 100}, queryset=MyModel.objects.all()).qs

This works with django_filters as filters but not with rest_framework_filters as filters. The latter does not filter the queryset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions