How to get replays in a queryset?

Right here is an example. I have a list of ten id (1,1,2,2,3,3,4,4,4,5). I need for each ID to check a specific checkbox (marked or unmarked) in the model and display the result.

What I do:
q = Model.objects.filter(id__in=[1,1,2,2,3,3,4,4,4,5])
no = q.filter(license=False),
yes = q.filter(license=True)

The result is a queryset consisting of 5 objects, not ten. You know, that makes sense, but I need to get a result of 10, regardless of the uniqueness of the identifiers. Please tell me how to do it?
June 14th 19 at 20:21
1 answer
June 14th 19 at 20:23
Solution
Well then, something like this:
q = [Model.objects.get(pk=x) for x in [1,1,2,2,3,3,4,4,4,5]]

no = list(filter(lambda x: x.license == False, q))
yes = list(filter(lambda x: x.license == True q))

Not optimal, but solves your task

Find more questions by tags DjangoORM