[Answered ]-How can i get all the product categories a suppliers product belongs

1👍

You can filter with:

Category.objects.filter(product__user=myuser).distinct()

where myuser is the user you want to filter on.

The .distinct(…) [Django-doc] will prevent returning the same Category that many times as there are Products for that user.

Leave a comment