forked from expo/troggle
Identified survey length discrepencies
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user