You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
Current implementation, will not scale for more users:
class HomeQuoteListView(ListView):
...
all_karma_leaders = sorted(User.objects.all(), key = lambda u: u.userprofile.leaderboard_karma_total, reverse=True)
# take only the top 5 karma_leaders
all_karma_leaders = all_karma_leaders[:5]
# remove the users who have submitted 0 quotes
# they may not want to have their username public
all_karma_leaders = [i for i in all_karma_leaders if i.userprofile.leaderboard_karma_total != None]
context['karma_leaders'] = all_karma_leaders
The text was updated successfully, but these errors were encountered:
Karma Leaderboard in home.py (this is repeated in podcast.py, episode.py, quote.py, and user.py)
Karma Leaderboard in models.py
Current implementation, will not scale for more users:
The text was updated successfully, but these errors were encountered: