Django Many To Many intersection filtering
问题 For the sake of simplicity let's say I only have 2 models: Book, Author class Author(models.Model): name = models.CharField(max_length='100') ... class Book(models.Model): name = models.CharField(max_length='100') authors = models.ManyToManyField(Author) ... I want to filter Books using a list of authors. What I tried to do is: authors = [...] # a list of author objects Books.objects.filter(authors__in=authors) But here, the authors will be ORed when I want them ANDed. Is there any way to AND