I have a list of strings, which will be generated dynamically. So it will be of variable length:
keywords = ['apples','oranges','bananas']
I have a model Fruitsalad, with a field 'description'. Lets say I want to find all Fruitsalads with either 'apples', 'oranges' or 'bananas' in the 'description' field
results = Fruitsalad.objects.filter(Q(description__icontains=keywords[0]) | Q(description__icontains=keywords[1] | Q(description__icontains=keywords[2])
How could I generate the above query when I don't know in advance how long the 'keywords' list will be?