I'm trying to filter database with Q objects. Here is my code:
arr = [1,2,3,4,5]
filter_obj = Q(key_value__in=arr)
print(filter_obj) # (AND: ('key_value__in', [u'1', u'2', u'3', u'4', u'5']))
As you see it's an AND operator. I want to filter with OR operator within this array. How can I implement this?
Note: We don't know the items in array.