summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshen2018-02-16 15:09:46 +0530
committerAkshen2018-02-16 15:09:46 +0530
commit1ee7a5f43bb488474e3f5baf8b19e9095e7f104a (patch)
tree78c443c66f7dc0c4d1088b77c5b53cee0e8a2868
parent0dfe3a2e7321ee10bb956ffd16ed960c7a81b19f (diff)
downloadworkshop_booking-1ee7a5f43bb488474e3f5baf8b19e9095e7f104a.tar.gz
workshop_booking-1ee7a5f43bb488474e3f5baf8b19e9095e7f104a.tar.bz2
workshop_booking-1ee7a5f43bb488474e3f5baf8b19e9095e7f104a.zip
Add Reverse Sorting to Profile Stats
-rw-r--r--statistics_app/views.py35
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):
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+