# Get blogs entries with id 1, 4 or 7
>>> Blog.objects.filter(pk__in=[1,4,7])
# Get all blog entries with id > 14
>>> Blog.objects.filter(pk__gt=14)
# Will return rows with 1 or 6 in colA and 'yourValue' in colB
YourModel.objects.filter(colA__in=[1,8],colB='yourValue')
# Will return rows with 1 or 6 in colA OR
# potentially different rows with 'yourValue' in colB
YourModel.objects.filter(colA__in=[1,8]).filter(colB='yourValue')
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', ]