summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2023-04-30 00:57:54 +0100
committerMartin Green <martin.speleo@gmail.com>2023-04-30 00:59:58 +0100
commited9f7b03bfdff0c7198ee5802a95d704e8deaabe (patch)
treefeddd6e8b231b641e424c33d4b86df3300150299
parentfc8584775e4f54c591cd1917b37acb397e7407c4 (diff)
downloadtroggle-ed9f7b03bfdff0c7198ee5802a95d704e8deaabe.tar.gz
troggle-ed9f7b03bfdff0c7198ee5802a95d704e8deaabe.tar.bz2
troggle-ed9f7b03bfdff0c7198ee5802a95d704e8deaabe.zip
Have entrance coordinates displayed to web pages. (Requires expo web entrance survey points to start with 1623 or 1626)
-rw-r--r--core/models/caves.py6
-rw-r--r--templates/cave.html8
2 files changed, 7 insertions, 7 deletions
diff --git a/core/models/caves.py b/core/models/caves.py
index 95cbeec..1155f81 100644
--- a/core/models/caves.py
+++ b/core/models/caves.py
@@ -306,10 +306,10 @@ class Entrance(TroggleModel):
return str(self.slug)
def exact_location(self):
- return SurvexStation.objects.lookup(self.exact_station)
+ return SurvexStation.objects.get(name = self.exact_station)
def other_location(self):
- return SurvexStation.objects.lookup(self.other_station)
+ return SurvexStation.objects.get(name = self.other_station)
def find_location(self):
r = {"": "To be entered ", "?": "To be confirmed:", "S": "", "L": "Lost:", "R": "Refindable:"}[self.findability]
@@ -370,7 +370,7 @@ class Entrance(TroggleModel):
return f[1]
def tag(self):
- return SurvexStation.objects.lookup(self.tag_station)
+ return SurvexStation.objects.get(name = self.tag_station)
def needs_surface_work(self):
return self.findability != "S" or not self.has_photo or self.marking != "T"
diff --git a/templates/cave.html b/templates/cave.html
index 8d6ea7e..41b292a 100644
--- a/templates/cave.html
+++ b/templates/cave.html
@@ -159,22 +159,22 @@
<dt>Explorers</dt><dd>{{ ent.entrance.explorers|safe }}</dd>
{% endif %}
{% if ent.entrance.northing %}
- <dt>Location</dt><dd>{{ ent.entrance.northing|safe }}, {{ ent.entrance.easting|safe }}, {{ ent.entrance.alt|safe }}m</dd>
+ <dt>Location</dt><dd>?BMN? Northing: {{ ent.entrance.northing|safe }}, Easting: {{ ent.entrance.easting|safe }}, {{ ent.entrance.alt|safe }}m</dd>
{% endif %}
{% if ent.entrance.tag_station %}
- <dt>Tag Location</dt><dd>{{ ent.entrance.tag_station }} {{ ent.entrance.tag.y|safe }}, {{ ent.entrance.tag.x|safe }}, {{ ent.entrance.tag.z|safe }}m</dd>
+ <dt>Tag Location</dt><dd>{{ ent.entrance.tag_station }} UTM33 {{ ent.entrance.tag.y|floatformat:0 }}, {{ ent.entrance.tag.x|floatformat:0 }}, {{ ent.entrance.tag.z|floatformat:0 }}m</dd>
{% endif %}
{% if ent.entrance.bearings %}
<dt>Bearings</dt><dd>{{ ent.entrance.bearings|safe }}</dd>
{% endif %}
{% if ent.entrance.exact_station %}
- <dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }} {{ ent.entrance.exact_location.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m</dd>
+ <dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }} UTM33 {{ ent.entrance.exact_location.y|floatformat:0 }}, {{ ent.entrance.exact_location.x|floatformat:0 }}, {{ ent.entrance.exact_location.z|floatformat:0 }}m</dd>
{% endif %}
{% if ent.entrance.other_station %}
<dt>Other Station</dt><dd>{{ ent.entrance.other_station|safe }}
{% if ent.entrance.other_description %}
- {{ ent.entrance.other_description|safe }}
- {% endif %} {{ ent.entrance.other_location.y|safe }}, {{ ent.entrance.other_location.x|safe }}, {{ ent.entrance.other_location.z|safe }}m
+ {% endif %} UTM33 {{ ent.entrance.other_location.y|floatformat:0 }}, {{ ent.entrance.other_location.x|floatformat:0 }}, {{ ent.entrance.other_location.z|floatformat:0 }}m
</dd>
{% endif %}
</dl>