[Answered ]-Problem with getting objects based on ManyToManyField relation

1👍

In case of a query with filter on many-to-many field, entries can appear repetedly in the result. Just change to

queryset = Meal.objects.filter(ingridients__in=ingrid).distinct()
        

to remove multible entries with .distinct()

Leave a comment