diff --git a/core/views/statistics.py b/core/views/statistics.py index 395858b..99af707 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -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}) diff --git a/settings.py b/settings.py index 218c27d..a73e437 100644 --- a/settings.py +++ b/settings.py @@ -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"), diff --git a/templates/eastings.html b/templates/eastings.html new file mode 100644 index 0000000..92c69ba --- /dev/null +++ b/templates/eastings.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} +{% block title %}Cave Entrance locations in UTM{% endblock %} + +{% block content %} + +

Entrance locations

+ +

+This is work in progress (May 2021). + + + +{% for ent in ents %} + + + + + + + + +{% endfor %} +
EntranceEastingNorthingtagtag exacttag other
{{ent.name|safe}}{{ent.easting|floatformat:2}}{{ent.northing|floatformat:2}}{{ent.tag_station}}{{ent.exact_station}}{{ent.other_station}}
+ + +{% endblock %} \ No newline at end of file diff --git a/urls.py b/urls.py index c83bfdb..d920cef 100644 --- a/urls.py +++ b/urls.py @@ -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/', todos, name="todos"),