From 026d959aebc0badfff46c93916f8b0e95ef25875 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 17 Nov 2023 21:26:26 +0200 Subject: [PATCH] Detecting data in field on cave --- core/views/caves.py | 3 ++- templates/cave_debug.html | 28 +++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/core/views/caves.py b/core/views/caves.py index ae9cef7..0d8c3e9 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -686,10 +686,11 @@ def ent(request, cave_id, ent_letter): def cave_debug(request): ents = Entrance.objects.all().order_by('id') + caves = Cave.objects.all().order_by('id') return render( request, "cave_debug.html", - {"ents": ents}, + {"ents": ents, "caves": caves}, ) def caveslist(request): diff --git a/templates/cave_debug.html b/templates/cave_debug.html index ce598ea..fe6e4cd 100644 --- a/templates/cave_debug.html +++ b/templates/cave_debug.html @@ -5,14 +5,15 @@ {% block content %} -

Entrances

-

These are Entrances read from the expoweb/entrance_data/*.html files. These are NOT the *entrance data points in the survex files. +

Entrances

+

These are Entrances read from the expoweb/entrance_data/*.html files. +These are NOT the *entrance data points in the survex files. -< + {% for ent in ents %} {% if ent.bearings %} @@ -37,5 +38,26 @@ {% endfor %}
entrance ent slug Best station LocationBearingsBearings
+

Caves with a specific field set

+ + + + + +{% for c in caves%} +{% if c.underground_centre_line %} + + + + +{% endif %} +{% endfor %} +
Caveslugunderground_centre_line
+ {{c}} + + {{c.slug}} + + {{c.underground_centre_line|safe}} +
{% endblock %}