From an example you can see a multiple OR query filter:
Article.objects.filter(Q(pk=1) | Q(pk=2) | Q(pk=3))
For example, this results in:
This one is for dynamic pk list:
pk_list = qs.values_list('pk', flat=True) # i.e [] or [1, 2, 3] if len(pk_list) == 0: Article.objects.none() else: q = None for pk in pk_list: if q is None: q = Q(pk=pk) else: q = q | Q(pk=pk) Article.objects.filter(q)