2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-18 01:47:05 +00:00

new report for Lost entrances

This commit is contained in:
2025-03-01 22:13:46 +00:00
parent 4e9c766493
commit 71c3fb12ab
4 changed files with 88 additions and 1 deletions

View File

@@ -167,7 +167,10 @@ def padnumber(x):
def numericalcmp(x, y):
return cmp(padnumber(x), padnumber(y))
def entKey(e):
k = caveKey(e.firstcave())
return k
def caveKey(c):
"""This function goes into a lexicographic sort function, and the values are strings,
but we want to sort numerically on kataster number before sorting on unofficial number.
@@ -239,6 +242,26 @@ def entranceindex(request):
{"entrances": ents},
)
def entrancetags(request):
ents = list(Entrance.objects.all())
ents1623 = []
for e in ents:
if e.slug[:4] == "1623":
if e.firstcave().kataster_number:
if int(e.firstcave().kataster_number) < 35:
continue
if e.best_station():
continue
if e.findability != "S": # it says we do not have coordinates
ents1623.append(e)
ents1623.sort(key=entKey)
return render(
request,
"entrancetags.html",
{"entrances": ents1623},
)
def cave3d(request, cave_id=""):
"""This is used to create a download url in templates/cave.html if anyone wants to download the .3d file