In my views.py I have a method:
#...... def get_filter_result(self, customer_type, tag_selected): list_customer_filter=[] customers_filter =
This works for both single and multiple conditions:
idseq = request.POST['tag'].split(',') tag_qs = reduce(operator.or_, (Q(tag__id=x) for x in idseq)) Customers.objects.filter(..., tag_qs)