Answer the question
In order to leave comments, you need to log in
How to implement a filter in Django with duplicate IDs?
Good afternoon.
It is necessary to make it so that when I wrote:
I was given a QS with two objects? Can you please tell me how to implement this?
Question.objects.filter(id__in=[1,1])
Answer the question
In order to leave comments, you need to log in
You probably also need to save the order, so first make a selection, and then, based on this list, create a new one, with values from the selection
If the task is not to find duplicates, then union can probably help you
https://docs.djangoproject.com/en/2.2/ref/models/q...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question