From 501692586d1a4191eb4229e35c0f0a2655faf982 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 28 Jun 2025 20:24:04 +0300 Subject: [PATCH] add multi year menu --- core/views/statistics.py | 1 + parsers/survex.py | 10 +++++++++- templates/survexfilewild.html | 27 ++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/core/views/statistics.py b/core/views/statistics.py index f1b73cc69..6c1e53897 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -82,6 +82,7 @@ def svxfilewild(request, year=None): "wildlength": wildlength, "foreignlength": foreignlength, "year":year, + "expeditions": Expedition.objects.all(), "svxwild": svxwild, "svxforeign": svxforeign} ) diff --git a/parsers/survex.py b/parsers/survex.py index 270bcea26..42b71a382 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -26,7 +26,7 @@ todo = """ easier to understand and maintain https://mathspp.com/blog/til/re-match-groupdict -- replace hard-coded instuments list with reding an editable textfile in expoweb. +- replace hard-coded instuments list with reading an editable textfile in expoweb. - Obscure bug in the *team inheritance and rootblock initialization needs tracking down, probably in the team cache which should NOT be global, but should be an instance variable of @@ -1092,6 +1092,13 @@ class LoadingSurvex: # delete the object to save memory survexleg = None + + def LoadSurvexMessteam(self, survexblock, args): + """Interpret the ; Messteam and ; Zeichner records, + Currently this just sets a flag that the survex block is not CUCC + """ + survexblock.foreigners = True + survexblock.save() def LoadSurvexRef(self, survexblock, args): """Interpret the *ref record, and all the many variants @@ -1640,6 +1647,7 @@ class LoadingSurvex: team = self.rx_commteam.match(comment) if team: # print(f'rx_commteam -- {comment=} in {survexblock.survexfile.path} :: {survexblock}') + self.LoadSurvexMessteam(survexblock, comment) pass diff --git a/templates/survexfilewild.html b/templates/survexfilewild.html index b2bb7f302..ce9527625 100644 --- a/templates/survexfilewild.html +++ b/templates/survexfilewild.html @@ -3,12 +3,32 @@ {% block content %} -

'Wild' Survex files

-

These are survex files which have NO ATTACHED WALLET. + +

'Wild' Survex files

+

+{% for otherexpedition in expeditions %} + | {{otherexpedition.year}} +{% endfor %} + +

These are survex blocks within a survex file which have NO ATTACHED WALLET.
i.e. they have a survex block (begin..end) with no *REF line which refers to the wallet holding the raw data for that block of data. +

These have "; Messteam" or "; Zeichner" in the survex block, so are non expo surveys. + + +{% for sb in svxforeign %} + + + + + + + +{% endfor %} +
survex block with no *refdateparent blockwithin survex filesurveyed length
{{ sb }} {{sb.date }} {{sb.parent }} {{sb.survexfile.path}} {{sb.legslength|floatformat:"1g" }}m
+

These do not have "; Messteam" or "; Zeichner" in the survex block, so are probably expo surveys; definitely if they have identified team members (or have zero length). {% for sb in svxwild %} @@ -22,7 +42,8 @@ i.e. they have a survex block (begin..end) with no *REF line which refers to the {% endfor %}
survex block with no *refdateparent blockwithin survex filesurveyed lengthteam

-So we are missing {{wildlength|floatformat:"0g"}}m of surveyed cave from our wallet records. +So we are missing {{wildlength|floatformat:"0g"}}m of wild surveyed cave from our wallet records.
+and there is {{foreignlength|floatformat:"0g"}}m of foreign (non-expo) surveyed cave from ARGE and others.

If the "team" field is empty, it probably means that it is an ARGE survey (in German) and so we do not recognise any participants as valid 'expo' members. Or it may mean that we did it, but that the survex file has been created since the last database reset.