def myview(request):
    venues = list(Venue.objects.filter())
venues.sort(key=getRanking, reverse=True)
return render(request, 'page.html', {'venues': venues})
How to return most popular items in a table, but where each item is unique?