Lets say tat I have such a model:
class Conversation(models.Model):
sid = models.CharField(
max_length=34,
primary_key=True
)
members = models.ManyToManyField(to=User)
I would like to find a Conversation that is connected exactly/only with users [1,2]
I tried this:
conversation = Conversation.objects.filter(
members__in=[1, 2]
)
But it returns all conversation that are connected with either user 1, or 2.
I tried this: other answer but It returns empty queryset.