Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django-filter for multiple values parameter

from django_filters import rest_framework as filters


class NumberInFilter(filters.BaseInFilter, filters.NumberFilter):
    pass


class AccommodationFilter(filters.FilterSet):
    accommodationType_id_in = NumberInFilter(field_name='accommodationType_id', lookup_expr='in')

    class Meta:
        model = Accommodation
        fields = ['accommodationType_id_in', ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #values #parameter
ADD COMMENT
Topic
Name
1+2 =