diff --git a/core/views/other.py b/core/views/other.py index 01e9f386d..433aecba0 100644 --- a/core/views/other.py +++ b/core/views/other.py @@ -150,6 +150,8 @@ def controlpanel(request): def folk_export(request): """Recreates the folk.csv file from the database contents WORK IN PROGRESS JULY 2025 + + THIS DOES NOT CHECK IN THE FILE with git """ def deslugify(slug): deslug = slug.replace("-"," ",1).title() diff --git a/core/views/statistics.py b/core/views/statistics.py index a71496650..512dd944f 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -54,11 +54,11 @@ def legs_and_lengths(expos): if sb.scanswallet == None: if sb.foreigners: svxforeign.append(sb) - print(f" FOREIGN {sb.survexfile} {sb.date}") + # print(f" FOREIGN {sb.survexfile} {sb.date}") foreignlength += sb.legslength elif sb.name != "rootblock": svxwild.append(sb) - print(f" WILD {sb.survexfile} {sb.date}") + # print(f" WILD {sb.survexfile} {sb.date}") wildlength += sb.legslength sb.year = f"{expedition}" people = SurvexPersonRole.objects.filter(survexblock=sb) @@ -71,8 +71,12 @@ def legs_and_lengths(expos): def svxfilewild(request, year=None): """Looks for survexfiles which do not have an associated wallet, per year. This should not be in this file, but with the other wallets reports. + + Note that the detection of non-cucc expo is done in parsers/survex.py by + rx_commteam = re.compile(r"(?i)\s*(Messteam|Zeichner|Gerätefehler|LUSS Dead Mountains)\s*[:]?(.*)") """ + non_cucc_signifiers = '"; Messteam", "; Zeichner", "; Gerätefehler:" or "; "LUSS Dead Mountains"' if not year: expos = Expedition.objects.all() @@ -100,6 +104,7 @@ def svxfilewild(request, year=None): "foreignlength": foreignlength, "year":year, "expeditions": Expedition.objects.all(), + "non_cucc_signifiers": non_cucc_signifiers, "svxwild": svxwild, "svxforeign": svxforeign} ) diff --git a/core/views/survex.py b/core/views/survex.py index 327b58cac..f0cdecd8d 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -400,6 +400,7 @@ def svx(request, survex_file): form.data["code"] = rcode # GET, also fall-through after POST-specific handling + if svxfile := get_survexfile(survex_file): print(f"svx(): a real SurvexFile object {svxfile=} {svxfile.id=}") @@ -418,7 +419,7 @@ def svx(request, survex_file): svxincludes = re.findall(r"(?i)\*include\s+(\S+)", form.data["code"] or "") # collect all the survex blocks which actually have a valid date - if svxfile: + if svxfile: #dirparent = Path(svxfile.primary.path).parent has_3d = (Path(SVXPATH) / Path(survex_file + ".3d")).is_file() try: @@ -749,7 +750,7 @@ def survexcavesingle(request, cave_shortname): """parsing all the survex files of a single cave and showing that it's consistent and can find all the files and people. - But might also be a link to a single survex file with no ".svx" suffix + But might also be a link to a single survex file with no ".svx" suffix, which may not be a cave. """ if cave_shortname.startswith("caves-16"): return svx(request, cave_shortname) @@ -769,7 +770,9 @@ def survexcavesingle(request, cave_shortname): # print(f"many {cave=} => {cave.sds=}") return render(request, "svxcaves.html", {"settings": settings, "caves": caves, "year": current_expo()}) else: - return render(request, "errors/svxcaves404.html", {"settings": settings, "cave": cave_shortname, "year": current_expo()}) + # survex file not a cave, e.g. surface/1623/allsurface.svx + return svx(request, cave_shortname) + # return render(request, "errors/svxcaves404.html", {"settings": settings, "cave": cave_shortname, "year": current_expo()}) def check_cave_registered(areacode, survex_cave): """Checks whether a cave has been properly registered when it is found in the Loser repo diff --git a/templates/survexfilewild.html b/templates/survexfilewild.html index a33f07293..a21005890 100644 --- a/templates/survexfilewild.html +++ b/templates/survexfilewild.html @@ -14,7 +14,7 @@

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", "; Zeichner", "; Gerätefehler:" or "; "LUSS Dead Mountains" in the survex block, so are non expo surveys. +

These have {{non_cucc_signifiers}} in the survex block, so are non expo surveys. @@ -23,21 +23,21 @@ 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 length *ref text
{{ sb }} {{sb.date }} {{sb.parent }} {{sb.parent }} {{sb.survexfile.path}} {{sb.legslength|floatformat:"1g" }}m {% if sb.ref_text %}{{sb.ref_text|truncatechars:50 }}{% endif %}
-

These do not have "; Messteam", "; Zeichner", "; Gerätefehler:" or "; "LUSS Dead Mountains" in the survex block, so are probably expo surveys; definitely if they have identified expo team members (or have zero length). +

These do not have {{non_cucc_signifiers}} in the survex block, so are probably expo surveys; definitely if they have identified expo team members (or have zero length). - + {% for sb in svxwild %} - +
survex block with no *refdateparent blockwithin survex filesurveyed lengthteam*ref text
survex block with no *refdateparent blockwithin survex filesurveyed lengthteam*ref text
{{ sb }} {{sb.date }} {{sb.parent }} {{sb.parent }} {{sb.survexfile.path}} {{sb.legslength|floatformat:"1g" }}m {{sb.team|truncatechars:50 }}