mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 07:40:19 +00:00
fix bug and make table better
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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}
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user