title: Django filter queryset __in for *every* item in list (2.0)
body: <p>I've already read <a href="https://stackoverflow.com/questions/31482723/django-django-filter-queryset-for-each-query-in-list">this</a> and <a href="https://stackoverflow.com/questions/8618068/django-filter-queryset-in-for-every-item-in-list">this</a>, but they don't solve my problem because they make a final "count" with a comparison to a number that is hard-coded. I want to make a comparison of a number that is the sum of all ingredients of the recipe itself.</p>
  
  <p>Let's imagine that I have some ingredients in my fridge, with their id's (= array of id's). I want to see what I can cook with that. I have my models like this:</p>
  
  <pre><code>class Ingredient(models.Model):
      label = models.CharField(max_length=200, null=True, blank=True,
                               default=None)
      description = models.TextField(null=True, blank=True, default=None)
  
  
  class Unit(models.Model):
      label = models.CharField(max_length=200, null=True, blank=True,
                               default=None)
      abbr = models.CharField(max_length=20, null=True, blank=True,
                              default=None)
  
  
  class IngredientUnit(models.Model):
      ingredient = models.ForeignKey(Ingredient, null=False, blank=True)
      unit = models.ForeignKey(Unit, null=False, blank=True)
      measurable = models.BooleanField(default=True, null=False, blank=True)
      is_int = models.BooleanField(default=True, null=False, blank=True)
      value = models.FloatField(null=True, blank=True, default=0.0)    
  
  
  class Recipe(models.Model):
      label = models.CharField(max_length=200, null=True, blank=True,
                               default=None)
      description = models.TextField(null=True, blank=True, default=None)
      ingredients = models.ManyToManyField(IngredientUnit)    
  </code></pre>
  
  <p>I'd like to do this: 'select all recipe that have <em>all</em>' the ingredients of an array of ingredient's pk. For example: "Classic Vanilla Cake" has those ingredients: eggs, all-purpose flour, baking powder, baking soda, butter, sugar, vanilla, buttermilk. If one is missing, "Classic Vanilla Cake" shouldn't be in the resulting query. On the contrary, if there are <em>more</em> ingredients than those required, "Classic Vanilla Cake" should always be in the resulting query.</p>
  
  <p>So far, I've done this, but it's not working.</p>
  
  <pre><code>    ingredient_ids = self.request.POST.getlist('ingredient[]', [])
      if len(ingredient_ids):
          recipes = Recipe.objects\
              .filter(ingredients__in=ingredient_ids)\
              .annotate(nb_ingredients=Count('ingredients'))\
              .filter(nb_ingredients=len(ingredient_ids))
          print([a for a in recipes])
  </code></pre>
  
  <p>The problem is that <code>nb_ingredients=len(ingredient_ids)</code> should be <code>nb_ingredients=the number of the ingredients of the current recipe</code></p>
  
  <p>How can I do this?</p>