diff --git a/core/views/statistics.py b/core/views/statistics.py index f3c5974..aa13fbf 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -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 diff --git a/templates/statistics.html b/templates/statistics.html index c60b297..74961fc 100644 --- a/templates/statistics.html +++ b/templates/statistics.html @@ -25,12 +25,15 @@ These authoritative results are maintained in an ODS-format spreadsheet.

+ {% for legs in legsbyexpo %} - + @@ -39,9 +42,7 @@ in an ODS-format spr {% endfor %}
YearSurvex
Survey
Blocks
Survex
Survey Legs
Survex
length(m)
CaversNon-caversmeters/caver
{{legs.0}}{{legs.0.survexblock_set.all|length}}{{legs.1.nblocks}} {{legs.1.nsurvexlegs|rjust:"10"|floatformat:"0g"}} {{legs.1.survexleglength|floatformat:"0g"}} {{legs.1.people|floatformat:"0g"}}
-

One Survex Survey Block is one *begin/*end block of data in a survex file. -Some files from other caving clubs may have a convention of using many more blocks per file than we do, e.g. if the -file is exported from other software into survex format, but each block is recorded on a single day. +

One Survex Survey Block is one *begin/*end block of data in a survex file. Different survex blocks in the same survex file can have different dates and surveyors.

The number of cavers excludes those attending who were not caving. This is something of a distortion as non-cavers may still be doing useful expo-related work such as prospecting, ferrying gear and preparing food. Non-cavers also include the bier tent and Rover Richardson, see the folk list for details. diff --git a/templates/survexfilewild.html b/templates/survexfilewild.html index a210058..42d1f23 100644 --- a/templates/survexfilewild.html +++ b/templates/survexfilewild.html @@ -63,7 +63,7 @@ Length of survex data referenced by wallets in this year {{walletslength|floatfo {% for legs in legsbyexpo %} {{legs.0}} - {{legs.0.survexblock_set.all|length}} + {{legs.1.nblocks}} {{legs.1.nsurvexlegs|rjust:"10"|floatformat:"0g"}} {{legs.1.survexleglength|floatformat:"0g"}}