2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 05:27:12 +00:00

Identified survey length discrepencies

This commit is contained in:
2023-03-12 01:09:17 +00:00
parent b88b142332
commit 35e9eb558d
6 changed files with 18 additions and 9 deletions

View File

@@ -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 = {