2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 20:49:14 +00:00

wild survex file report

This commit is contained in:
2023-08-05 12:43:06 +03:00
parent b709dd2f1b
commit 7df2d44748
3 changed files with 90 additions and 0 deletions

View File

@@ -15,7 +15,50 @@ from troggle.parsers.people import GetPersonExpeditionNameLookup, foreign_friend
the status of data inconsistencies
"""
def svxfilewild(request, year=None):
"""Looks for survexfiles which do not have an associated
wallet, per year
"""
legsbyexpo = []
addupsurvexlength = 0.0
addupsurvexlegs = 0
if not year:
expos = Expedition.objects.all()
else:
expos = Expedition.objects.filter(year=year)
for expedition in expos:
survexblocks = expedition.survexblock_set.all()
legsyear = 0
survexleglength = 0.0
for survexblock in survexblocks:
survexleglength += survexblock.legslength
legsyear += int(survexblock.legsall)
addupsurvexlength += survexleglength
addupsurvexlegs += legsyear
legsbyexpo.append((expedition, {"nsurvexlegs": legsyear, "survexleglength": survexleglength}))
legsbyexpo.reverse()
svxwild = []
for expedition in expos:
survexblocks = expedition.survexblock_set.all()
for sb in survexblocks:
# print(f"{sb=}")
if sb.scanswallet == None:
if sb.name != "rootblock":
svxwild.append(sb)
print(f" WILD {sb.survexfile} {sb.date}")
# else:
# print(f" TAME {sb.survexfile}")
return render(request, "survexfilewild.html",
{"addupsurvexlength": addupsurvexlength / 1000,
"legsbyexpo": legsbyexpo,
"nsurvexlegs": addupsurvexlegs,
"svxwild": svxwild}
)
def therionissues(request):
"""Page displaying contents of a file produced during data import"""
logname = "therionrefs.log"