title: Filter objects from a table based on ManyToMany field
body: <p>I am working on a messaging app.
  The models are as follows.</p>
  <pre><code>class ChatRoom(SafeDeleteModel):
    _safedelete_policy = SOFT_DELETE_CASCADE
  
    room_name = models.CharField(max_length=100, null=True, blank=True)
    participants = models.ManyToManyField(User)
  
   class Meta:
      db_table = TABLE_PREFIX + &quot;chat_room&quot;
  
  
  class Message(SafeDeleteModel):
    _safedelete_policy = SOFT_DELETE_CASCADE
  
    chat_room = models.ForeignKey(ChatRoom, on_delete=models.CASCADE)
    message = models.TextField()
    sent_by = models.ForeignKey(User, on_delete=models.CASCADE)
    created_on = models.DateTimeField(default=django.utils.timezone.now)
  
   class Meta:
      db_table = TABLE_PREFIX + &quot;chat_message&quot;
  </code></pre>
  <p>I have to filter ChatRoom object which contains a list of users.</p>
  <p>Eg: On sending data like this to the api</p>
  <pre><code>{
    &quot;participants&quot;: [2,3]
  }
  </code></pre>
  <p>It should return a ChatRoom object which contains both user '2' and user '3' as participants.</p>
  <p>I had tried filtering it with</p>
  <pre><code>room = ChatRoom.objects.filter(participants__in=serializer.validated_data['participants'])
  </code></pre>
  <p>but it returns a list of room objects with user '1' and user '2'.</p>
  <p>I had also tried using get() but it returns an error.</p>
  <p>What am I doing wrong and how can i do it right?</p>
  <p>Thanks for looking into my problem. Hope you have a solution.</p>