2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 14:51:38 +00:00

now consistent with survex blocks only from expo

This commit is contained in:
2025-10-31 12:19:21 +02:00
parent 0a5e779dfd
commit e39037b333
3 changed files with 9 additions and 6 deletions

View File

@@ -28,11 +28,13 @@ def legs_by_expo(expos):
for expedition in expos:
survexblocks = expedition.survexblock_set.all()
legsyear = 0
nblocks = 0
survexleglength = 0.0
for sb in survexblocks:
if not sb.foreigners:
survexleglength += sb.legslength
legsyear += int(sb.legsall)
nblocks += 1
addupsurvexlength += survexleglength
addupsurvexlegs += legsyear
@@ -42,7 +44,7 @@ def legs_by_expo(expos):
else:
success = ""
tourists = PersonExpedition.objects.filter(expedition=expedition, noncaver=True).count()
legsbyexpo.append((expedition, {"success":success, "people": expoers, "tourists": tourists, "nsurvexlegs": legsyear, "survexleglength": survexleglength}))
legsbyexpo.append((expedition, {"success":success, "people": expoers, "tourists": tourists, "nsurvexlegs": legsyear, "survexleglength": survexleglength, "nblocks": nblocks}))
legsbyexpo.reverse()
return legsbyexpo, addupsurvexlegs, addupsurvexlength