summaryrefslogtreecommitdiffstats
path: root/core/views/prospect.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/prospect.py')
-rw-r--r--core/views/prospect.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/views/prospect.py b/core/views/prospect.py
index a538ab6..1eb82cd 100644
--- a/core/views/prospect.py
+++ b/core/views/prospect.py
@@ -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})