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

length of unreference cave survey added

This commit is contained in:
2023-08-05 14:15:35 +03:00
parent ee5a2c9ef8
commit 12aa6ced86
4 changed files with 27 additions and 14 deletions

View File

@@ -8,6 +8,7 @@ from troggle.core.models.caves import Cave, Entrance
from troggle.core.models.logbooks import LogbookEntry
from troggle.core.models.survex import SurvexStation, SurvexPersonRole
from troggle.core.models.troggle import DataIssue, Expedition, Person, PersonExpedition
from troggle.core.models.wallets import Wallet
from troggle.parsers.people import GetPersonExpeditionNameLookup, foreign_friends
# from django.views.generic.list import ListView
@@ -22,12 +23,12 @@ def svxfilewild(request, year=None):
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
@@ -41,6 +42,7 @@ def svxfilewild(request, year=None):
legsbyexpo.reverse()
svxwild = []
wildlength = 0.0
for expedition in expos:
survexblocks = expedition.survexblock_set.all()
for sb in survexblocks:
@@ -49,19 +51,26 @@ def svxfilewild(request, year=None):
if sb.name != "rootblock":
svxwild.append(sb)
print(f" WILD {sb.survexfile} {sb.date}")
wildlength += sb.legslength
sb.year = f"{expedition}"
people = SurvexPersonRole.objects.filter(survexblock=sb)
team = []
for p in people:
team.append(p.personname)
sb.team = team
# else:
# print(f" TAME {sb.survexfile}")
walletslength = 0.0
if year:
wallets = Wallet.objects.filter(walletyear__year=year)
for w in wallets:
for sb in w.survexblock_set.all():
walletslength += sb.legslength
return render(request, "survexfilewild.html",
{"addupsurvexlength": addupsurvexlength / 1000,
"legsbyexpo": legsbyexpo,
"nsurvexlegs": addupsurvexlegs,
"walletslength": walletslength,
"wildlength": wildlength,
"svxwild": svxwild}
)