diff options
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r-- | core/views/statistics.py | 7 |
1 files changed, 5 insertions, 2 deletions
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 = { |