forked from expo/troggle
survey legs calc fixed
This commit is contained in:
parent
3813b21dcf
commit
c9931fd45e
@ -130,22 +130,21 @@ def stats(request):
|
|||||||
|
|
||||||
legsbyexpo = [ ]
|
legsbyexpo = [ ]
|
||||||
addupsurvexlength = 0
|
addupsurvexlength = 0
|
||||||
|
addupsurvexlegs = 0
|
||||||
for expedition in Expedition.objects.all():
|
for expedition in Expedition.objects.all():
|
||||||
survexblocks = expedition.survexblock_set.all()
|
survexblocks = expedition.survexblock_set.all()
|
||||||
legsyear=0
|
legsyear=0
|
||||||
survexleglength = 0.0
|
survexleglength = 0.0
|
||||||
for survexblock in survexblocks:
|
for survexblock in survexblocks:
|
||||||
survexleglength += survexblock.legslength
|
survexleglength += survexblock.legslength
|
||||||
try:
|
legsyear += int(survexblock.legsall)
|
||||||
legsyear += int(survexblock.legsall)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
addupsurvexlength += survexleglength
|
addupsurvexlength += survexleglength
|
||||||
|
addupsurvexlegs += legsyear
|
||||||
legsbyexpo.append((expedition, {"nsurvexlegs": "{:,}".format(legsyear),
|
legsbyexpo.append((expedition, {"nsurvexlegs": "{:,}".format(legsyear),
|
||||||
"survexleglength":"{:,.0f}".format(survexleglength)}))
|
"survexleglength":"{:,.0f}".format(survexleglength)}))
|
||||||
legsbyexpo.reverse()
|
legsbyexpo.reverse()
|
||||||
|
|
||||||
renderDict = {**statsDict, **{ "addupsurvexlength":addupsurvexlength/1000, "legsbyexpo":legsbyexpo }} # new syntax
|
renderDict = {**statsDict, **{ "addupsurvexlength":addupsurvexlength/1000, "legsbyexpo":legsbyexpo, "nsurvexlegs":addupsurvexlegs }} # new syntax
|
||||||
return render(request,'statistics.html', renderDict)
|
return render(request,'statistics.html', renderDict)
|
||||||
|
|
||||||
def dataissues(request):
|
def dataissues(request):
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
<p>{{ expoCount }} expeditions: {{ personCount }} people, {{ caveCount }} caves and {{ logbookEntryCount }} logbook entries.
|
<p>{{ expoCount }} expeditions: {{ personCount }} people, {{ caveCount }} caves and {{ logbookEntryCount }} logbook entries.
|
||||||
|
|
||||||
<p>Number of survey legs: {{nsurvexlegs}} «Removed from model, needs calculating..»<br />
|
<p>Number of survey legs: {{nsurvexlegs}} <br />
|
||||||
Total length: {{addupsurvexlength|stringformat:".1f"}} km adding up the total for each year.</p>
|
Total length: {{addupsurvexlength|stringformat:".1f"}} km adding up the total for each year.</p>
|
||||||
|
|
||||||
<p>These are uncorrected tape lengths which include pitches and duplicates but exclude splays or surface-surveys.
|
<p>These are uncorrected tape lengths which include pitches and duplicates but exclude splays or surface-surveys.
|
||||||
<p>
|
<p>
|
||||||
This is work in progress (March 2021).
|
This is work in progress (April 2022).
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr><th>Year</th><th>Survex<br>Survey<br>Blocks</th><th>Survex<br>Survey Legs</th><th>Total length<br>(m)</th></tr>
|
<tr><th>Year</th><th>Survex<br>Survey<br>Blocks</th><th>Survex<br>Survey Legs</th><th>Total length<br>(m)</th></tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user