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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user