mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-17 23:17:11 +00:00
Removed class Area, use Cave.areacode Cave.subarea
This commit is contained in:
@@ -4,7 +4,7 @@ from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
|
||||
import troggle.settings as settings
|
||||
from troggle.core.models.caves import Area, Cave, Entrance
|
||||
from troggle.core.models.caves import Cave, Entrance
|
||||
from troggle.core.views.caves import caveKey
|
||||
|
||||
# from pathlib import Path
|
||||
@@ -68,11 +68,11 @@ def prospecting(request):
|
||||
return render(request, "errors/disabled.html", {"message": message})
|
||||
|
||||
areas = []
|
||||
for key, name in AREANAMES:
|
||||
a = Area.objects.get(short_name=key) # assumes unique
|
||||
caves = list(a.cave_set.all())
|
||||
caves.sort(key=caveKey)
|
||||
areas.append((name, a, caves))
|
||||
caves = Cave.objects.all()
|
||||
|
||||
for c in caves:
|
||||
if c.subarea in AREANAMES:
|
||||
areas.append((AREANAMES[c.subarea], subarea, c))
|
||||
return render(request, "prospecting.html", {"areas": areas})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user