diff options
author | Akshen | 2018-02-16 15:44:56 +0530 |
---|---|---|
committer | GitHub | 2018-02-16 15:44:56 +0530 |
commit | d437db05771c1da8b9512226c48a04c7213e121a (patch) | |
tree | 78c443c66f7dc0c4d1088b77c5b53cee0e8a2868 | |
parent | aadf4afec1ff4517f8b4df7ed662ece52fb56ffd (diff) | |
parent | 1ee7a5f43bb488474e3f5baf8b19e9095e7f104a (diff) | |
download | workshop_booking-d437db05771c1da8b9512226c48a04c7213e121a.tar.gz workshop_booking-d437db05771c1da8b9512226c48a04c7213e121a.tar.bz2 workshop_booking-d437db05771c1da8b9512226c48a04c7213e121a.zip |
Merge pull request #40 from Akshen/develop
Add Reverse Sorting to Profile Stats
-rw-r--r-- | statistics_app/views.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/statistics_app/views.py b/statistics_app/views.py index 0613546..2382e4e 100644 --- a/statistics_app/views.py +++ b/statistics_app/views.py @@ -24,6 +24,7 @@ from django.conf import settings from os import listdir, path, sep from zipfile import ZipFile from django.contrib import messages +from operator import itemgetter import datetime as dt import csv try: @@ -499,6 +500,12 @@ def profile_stats(request): proposed_workshop_coordinator_id=p['profile'].user.id, status='ACCEPTED').count() + #Sorting + coordinator_profile = sorted(coordinator_profile, + key=lambda k:k['count'], reverse=True) + instructor_profile = sorted(instructor_profile, + key=lambda k:k['count'], reverse=True) + return render(request, "statistics_app/profile_stats.html", { "instructor_data": instructor_profile, @@ -510,3 +517,31 @@ def profile_stats(request): + + + + + + + + + + + + + + + + + + + + + + + + + + + + |