summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/context.py8
-rw-r--r--core/forms.py4
-rw-r--r--core/middleware.py1
-rw-r--r--core/unused.py4
-rw-r--r--core/views/caves.py7
-rw-r--r--core/views/statistics.py3
-rw-r--r--core/views/survex.py4
7 files changed, 28 insertions, 3 deletions
diff --git a/core/context.py b/core/context.py
index 908cd69..d2de27b 100644
--- a/core/context.py
+++ b/core/context.py
@@ -1,5 +1,13 @@
from django.conf import settings
from troggle.core.models.troggle import Expedition
+'''This is the only troglle-specific 'context processor' that troggle uses
+in the processing of Django templates
+
+This seems to mean that every page produced has bundled in its context the complete 'settings' and
+the expedition class object, so all templates can doe queries on Expedition.
+https://betterprogramming.pub/django-quick-tips-context-processors-da74f887f1fc
+'''
+
def troggle_context(request):
return { 'settings':settings, 'Expedition':Expedition } \ No newline at end of file
diff --git a/core/forms.py b/core/forms.py
index 73d541a..f435e4c 100644
--- a/core/forms.py
+++ b/core/forms.py
@@ -11,6 +11,10 @@ from django.contrib.admin.widgets import AdminDateWidget
from troggle.core.models.troggle import Person, PersonExpedition, Expedition
from troggle.core.models.caves import Cave, LogbookEntry, QM, Entrance, CaveAndEntrance
+'''These are all the Forms used by troggle
+Some are not used and need renovating or destroying.
+'''
+
class CaveForm(ModelForm):
underground_description = forms.CharField(required = False, widget=forms.Textarea())
explorers = forms.CharField(required = False, widget=forms.Textarea())
diff --git a/core/middleware.py b/core/middleware.py
index 56078a9..91e64ec 100644
--- a/core/middleware.py
+++ b/core/middleware.py
@@ -2,6 +2,7 @@ from django.conf import settings
from django import http
from django.urls import reverse, resolve,Resolver404
"""Non-standard django middleware is loaded from this file.
+It needs re-writing to be compatible with Django v2.0+
"""
class SmartAppendSlashMiddleware(object):
diff --git a/core/unused.py b/core/unused.py
index c4e9ba3..76f55f4 100644
--- a/core/unused.py
+++ b/core/unused.py
@@ -5,8 +5,8 @@ import logging
from django.conf import settings
from django.shortcuts import render
-"""Oddball mixture of critical, superfluous and useful functions which should
-be re-located more sensibly to other modules:
+"""Oddball mixture of apparently now superfluous functions which should
+be deleted
various HTML/wiki functions presumably for logbooks?
diff --git a/core/views/caves.py b/core/views/caves.py
index 8884d46..b4c2932 100644
--- a/core/views/caves.py
+++ b/core/views/caves.py
@@ -15,13 +15,18 @@ from django.shortcuts import get_object_or_404, render
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
import troggle.settings as settings
-#import troggle.core.models as models
from troggle.core.views import expo
from troggle.core.models.troggle import Expedition, DataIssue
from troggle.core.models.caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation, GetCaveLookup
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm
from .login import login_required_if_public
+'''Manages the complex procedures to assemble a cave description out of the compnoents
+Manages the use of cavern to parse survex files to produce 3d and pos files
+
+Also generates the prospecting guide document.
+'''
+
class MapLocations(object):
p = [
("laser.0_7", "BNase", "Reference", "Bräuning Nase laser point"),
diff --git a/core/views/statistics.py b/core/views/statistics.py
index fc62754..c317d43 100644
--- a/core/views/statistics.py
+++ b/core/views/statistics.py
@@ -17,6 +17,9 @@ from troggle.core.models.survex import SurvexBlock
import troggle.settings as settings
+'''Very simple report pages summarizing data about the whole set of expeditions and of
+the status of data inconsistencies
+'''
def pathsreport(request):
pathsdict = OrderedDict()
diff --git a/core/views/survex.py b/core/views/survex.py
index 2bcf79f..350c404 100644
--- a/core/views/survex.py
+++ b/core/views/survex.py
@@ -19,6 +19,10 @@ from troggle.core.models.survex import SurvexBlock, SurvexPersonRole, SurvexFile
from troggle.core.models.caves import Cave, PersonTrip, LogbookEntry
from troggle.parsers.people import GetPersonExpeditionNameLookup
+'''Everything that views survexfiles
+but also displays data on a cave or caves when there is ambiguity
+'''
+
survexdatasetpath = Path(settings.SURVEX_DATA)
survextemplatefile = """; *** THIS IS A TEMPLATE FILE NOT WHAT YOU MIGHT BE EXPECTING ***