[Solved]-How to obtain distinct values over Django Query Set?

26👍

Did you try attaching a .distinct() to the queryset?

categories = Category.objects.filter(post__genders=1).exclude(post=
      None).order_by('-sort').distinct()

Leave a comment