0

I have a query:

titles= Entry.objects.filter(created_date__gte=date_from,user__followed__follower=request.user).order_by('-created_date').values_list('title', flat=True).distinct()

It works fine except the distinct part which doesn't work and distinct("title") is not supported by the database I'm using. Performing set() on the query object without using distinct() brakes the order. The only solution I came up with is to append every title in a list and check if it already exists there, which probably is an overkill.

Thank you for reading.

knittl
  • 246,190
  • 53
  • 318
  • 364
mattarello
  • 219
  • 2
  • 11

0 Answers0