I have a list of names, e.g.:
name_list = [\'Alpha\', \'bEtA\', \'omegA\']
Currently I have the following queryset:
MyModel
Here's my solution, which uses Q objects instead:
name_list = ['Alpha', 'bEtA', 'omegA'] q_list = map(lambda n: Q(name__iexact=n), name_list) q_list = reduce(lambda a, b: a | b, q_list) MyModel.objects.filter(q_list)