From a7660c8ec7d031adf2198725694ca1572269e9c9 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Tue, 14 Mar 2023 16:11:37 +0000 Subject: [PATCH] QM report updating --- core/models/logbooks.py | 13 ++++++++----- templates/qm.html | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/models/logbooks.py b/core/models/logbooks.py index 5933848..5f83059 100644 --- a/core/models/logbooks.py +++ b/core/models/logbooks.py @@ -137,6 +137,8 @@ class PersonLogEntry(TroggleModel): class QM(TroggleModel): """This is based on qm.csv in trunk/expoweb/1623/204 which has the fields: "Number","Grade","Area","Description","Page reference","Nearest station","Completion description","Comment" + + All the stuff handling TICK QMs is INCOMPLETE """ cave = models.ForeignKey("Cave", related_name="QMs", blank=True, null=True, on_delete=models.SET_NULL) @@ -193,7 +195,8 @@ class QM(TroggleModel): return f"{cavestr}-{expoyearstr}-{self.number}{self.grade}{blocknamestr}" def get_completion_url(self): - """assumes html file named is in same folder as cave description file""" + """assumes html file named is in same folder as cave description file + WRONG - needs rewriting!""" cd = None if self.completion_description: try: @@ -223,8 +226,8 @@ class QM(TroggleModel): ), ) - def get_next_by_id(self): - return QM.objects.get(id=self.id + 1) + # def get_next_by_id(self): + # return QM.objects.get(id=self.id + 1) - def get_previous_by_id(self): - return QM.objects.get(id=self.id - 1) + # def get_previous_by_id(self): + # return QM.objects.get(id=self.id - 1) diff --git a/templates/qm.html b/templates/qm.html index 0a36098..44aa6dc 100644 --- a/templates/qm.html +++ b/templates/qm.html @@ -70,9 +70,9 @@ Found by {{qm.found_by}} on {{qm.

Completion

{% if qm.ticked %} Ticked off log entry: {{qm.ticked_off_by}}
-Ticked off Description Page: {{qm.get_completion_url}}
+Ticked off date: {{qm.get_completion_url}} WRONG
Tick off date: [For survex file ticks. not implemented yet, needs model change]
-Tick off comment: [For survex file ticks. not implemented yet, needs model change] +Tick off completion description: {{qm.completion_description}} {% else %} No completion description yet- STILL EXTANT.