7 | | ingredients = ['tomato'] |
8 | | self.queryset = Recipe.objects.all() |
9 | | self.queryset = self.queryset.annotate(total=Count('steps__ingredients', distinct=True)) |
10 | | self.queryset = self.queryset.filter(steps__ingredients__ingredient__name__in=ingredients) |
11 | | self.queryset = self.queryset.annotate(available=Count('steps__ingredients', distinct=True)) |
12 | | self.queryset = self.queryset.filter(total=F('available')) |
| 7 | ingredients = ['tomato'] |
| 8 | self.queryset = Recipe.objects.all() |
| 9 | self.queryset = self.queryset.annotate(total=Count('steps__ingredients', distinct=True)) |
| 10 | self.queryset = self.queryset.filter(steps__ingredients__ingredient__name__in=ingredients) |
| 11 | self.queryset = self.queryset.annotate(available=Count('steps__ingredients', distinct=True)) |
| 12 | self.queryset = self.queryset.filter(total=F('available')) |