I have QueryDict with list 'value': ['1', '2', '3', '4', '5']
- number of elements is unknown. I need convert this list to filter model using OR condition:
Poll.objects.get(Q(value__icontains=option[0]) | Q(value__icontains=option[1]))
In SQL:
AND (value LIKE '%1%' OR value LIKE '%2%')
How to achieve this correct and easy way ?