From 35e9eb558d0ef7fb34d8ed7140a684cdce0998cf Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 12 Mar 2023 01:09:17 +0000 Subject: Identified survey length discrepencies --- core/views/statistics.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/views/statistics.py') diff --git a/core/views/statistics.py b/core/views/statistics.py index b7af823..8392f64 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -166,6 +166,9 @@ def pathsreport(request): def stats(request): + """Calculates number of survey blocks, the number of survey legs and the survey length for each year. + This is only underground survey legs, but includes ARGE as well as Expo survex files. + """ statsDict = {} statsDict["expoCount"] = f"{Expedition.objects.count():,}" statsDict["caveCount"] = f"{Cave.objects.count():,}" @@ -173,7 +176,7 @@ def stats(request): statsDict["logbookEntryCount"] = f"{LogbookEntry.objects.count():,}" legsbyexpo = [] - addupsurvexlength = 0 + addupsurvexlength = 0.0 addupsurvexlegs = 0 for expedition in Expedition.objects.all(): survexblocks = expedition.survexblock_set.all() @@ -184,7 +187,7 @@ def stats(request): legsyear += int(survexblock.legsall) addupsurvexlength += survexleglength addupsurvexlegs += legsyear - legsbyexpo.append((expedition, {"nsurvexlegs": f"{legsyear:,}", "survexleglength": f"{survexleglength:,.0f}"})) + legsbyexpo.append((expedition, {"nsurvexlegs": legsyear, "survexleglength": survexleglength})) legsbyexpo.reverse() renderDict = { -- cgit v1.2.3