Northings and Easting report

This commit is contained in:
Philip Sargent 2021-05-07 22:42:10 +01:00
parent 41ed15f47f
commit 1ff723554c
4 changed files with 42 additions and 4 deletions

View File

@ -12,7 +12,7 @@ from django.utils import timezone
#from django.views.generic.list import ListView
from troggle.core.models.troggle import Expedition, Person, PersonExpedition, DataIssue
from troggle.core.models.caves import Cave, LogbookEntry
from troggle.core.models.caves import Cave, LogbookEntry, Entrance
from troggle.core.models.survex import SurvexBlock
import troggle.settings as settings
@ -157,3 +157,14 @@ def dataissues(request):
dilist.sort(key = myFunc)
return render(request,'dataissues.html', {'didict': dilist})
def eastings(request):
'''report each Northing/Easting pair wherever recorded
'''
ents = []
entrances = Entrance.objects.all()
for e in entrances:
if e.easting or e.northing:
ents.append(e)
return render(request,'eastings.html', {'ents': ents})

View File

@ -98,9 +98,9 @@ LOGBOOK_PARSER_SETTINGS = {
"1992": ("1992/log.htm", "Parseloghtml01"),
"1991": ("1991/log.htm", "Parseloghtml01"),
"1990": ("1990/log.htm", "Parseloghtml01"),
"1989": ("1989/log.htm", "Parseloghtml01"),
"1988": ("1988/log.htm", "Parseloghtml01"),
"1987": ("1987/log.htm", "Parseloghtml01"),
"1989": ("1989/log.htm", "Parseloghtml01"), #crashes MySQL
"1988": ("1988/log.htm", "Parseloghtml01"), #crashes MySQL
"1987": ("1987/log.htm", "Parseloghtml01"), #crashes MySQL
"1985": ("1985/log.htm", "Parseloghtml01"),
"1984": ("1984/log.htm", "Parseloghtml01"),
"1983": ("1983/log.htm", "Parseloghtml01"),

26
templates/eastings.html Normal file
View File

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block title %}Cave Entrance locations in UTM{% endblock %}
{% block content %}
<h1>Entrance locations</h1>
<p>
This is work in progress (May 2021).
<table>
<tr><th>Entrance</th><th>Easting</th><th>Northing</th><th>tag</th><th>tag exact</th><th>tag other</th></tr>
{% for ent in ents %}
<tr>
<td style="text-align:left"><a href="{{ ent.name }}">{{ent.name|safe}}</a></td>
<td style="text-align:right">{{ent.easting|floatformat:2}}</td>
<td style="text-align:right">{{ent.northing|floatformat:2}}</td>
<td style="text-align:right">{{ent.tag_station}}</td>
<td style="text-align:right">{{ent.exact_station}}</td>
<td style="text-align:right">{{ent.other_station}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -132,6 +132,7 @@ trogglepatterns = [
path('stats', statistics.stats, name="stats"),
path('pathsreport', statistics.pathsreport, name="pathsreport"),
path('dataissues', statistics.dataissues, name="dataissues"),
path('eastings', statistics.eastings, name="eastings"),
path('troggle', frontpage, name="frontpage"), # control panel. Shows recent actions.
path('todo/<path:module>', todos, name="todos"),