diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-06-12 18:10:07 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-06-12 18:10:07 +0100 |
commit | 269b8840add3ee061ae7db2e148fe119f1c399db (patch) | |
tree | fd74a9c4687da67b372cac7b59552e782d237240 /core/views_other.py | |
parent | b9a223c0490e8e582cdf44d7f95412d10bfd121c (diff) | |
download | troggle-269b8840add3ee061ae7db2e148fe119f1c399db.tar.gz troggle-269b8840add3ee061ae7db2e148fe119f1c399db.tar.bz2 troggle-269b8840add3ee061ae7db2e148fe119f1c399db.zip |
import fixes & statistics table
Diffstat (limited to 'core/views_other.py')
-rw-r--r-- | core/views_other.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/core/views_other.py b/core/views_other.py index c31777a..9fa34c0 100644 --- a/core/views_other.py +++ b/core/views_other.py @@ -20,29 +20,6 @@ print("** importing troggle/core/views_other.py") def showrequest(request): return HttpResponse(request.GET) -def stats(request): - statsDict={} - statsDict['expoCount'] = int(Expedition.objects.count()) - statsDict['caveCount'] = int(Cave.objects.count()) - statsDict['personCount'] = int(Person.objects.count()) - statsDict['logbookEntryCount'] = int(LogbookEntry.objects.count()) - - legsbyexpo = [ ] - for expedition in Expedition.objects.all(): - survexblocks = expedition.survexblock_set.all() - survexlegs = [ ] - survexleglength = 0.0 - for survexblock in survexblocks: - survexlegs.extend(survexblock.survexleg_set.all()) - survexleglength += survexblock.totalleglength - legsbyexpo.append((expedition, {"nsurvexlegs":len(survexlegs), "survexleglength":survexleglength/1000})) - legsbyexpo.reverse() - survexlegs = SurvexLeg.objects.all() - totalsurvexlength = sum([survexleg.tape for survexleg in survexlegs]) - - renderDict = {**statsDict, **{ "nsurvexlegs":len(survexlegs), "totalsurvexlength":totalsurvexlength/1000, "legsbyexpo":legsbyexpo }} # new syntax - return render(request,'statistics.html', renderDict) - def frontpage(request): if request.user.is_authenticated(): return render(request,'tasks.html') |