summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-12-10 20:09:25 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2024-12-10 20:09:25 +0000
commit8c56a45e7c89f580afc59f670443bc1eb9812e36 (patch)
tree329b42ebc7e32b15d9f187d227e2c44e24b0424c
parent700512c0085a605dfe604f71d8e04ee08c3db954 (diff)
downloadtroggle-8c56a45e7c89f580afc59f670443bc1eb9812e36.tar.gz
troggle-8c56a45e7c89f580afc59f670443bc1eb9812e36.tar.bz2
troggle-8c56a45e7c89f580afc59f670443bc1eb9812e36.zip
preserving expoer order in logbook entries attempt 1
-rw-r--r--core/models/logbooks.py11
-rw-r--r--core/views/uploads.py2
-rw-r--r--templates/logbook2005style.html4
3 files changed, 9 insertions, 8 deletions
diff --git a/core/models/logbooks.py b/core/models/logbooks.py
index 326a097..5b6c469 100644
--- a/core/models/logbooks.py
+++ b/core/models/logbooks.py
@@ -136,8 +136,8 @@ def writelogbook(year, filename):
# print(f'Logbook exported to {filepath}')
class PersonLogEntry(TroggleModel):
- """Single Person going on a trip, which may or may not be written up.
- It could account for different T/U for people in same logbook entry.
+ """Single Person going on a trip.
+ In future it could account for different T/U for people in same logbook entry.
CASCADE means that if the personexpedition or the logbookentry is deleted,
then this PersonLogEntry is deleted too
@@ -150,8 +150,11 @@ class PersonLogEntry(TroggleModel):
nickname_used = models.CharField(max_length=100,default="") # e.g. "Animal" or "Zonker", as it appears in the original logbook
class Meta:
- ordering = ("-personexpedition",)
- # order_with_respect_to = 'personexpedition'
+ ordering = ("nickname_used", "-personexpedition")
+ # order_with_respect_to = 'personexpedition' and then with nickname
+ # within the same logbook entry (which will always be the same expedition) this will
+ # now not re-order the participants in a trip every time we save the logbook.
+ # but this does not work.. need a function
def next_personlog(self):
futurePTs = (
diff --git a/core/views/uploads.py b/core/views/uploads.py
index 5d45303..eae6f0a 100644
--- a/core/views/uploads.py
+++ b/core/views/uploads.py
@@ -461,7 +461,7 @@ def logbookedit(request, year=None, slug=None):
+ str(lbe_commit.returncode)
)
message = (
- f"! - FORM Logbook Edit -Error code '{lbe_commit.returncode}' with git on server for {filename}. {slug} edits saved, added to git, but NOT committed.\n"
+ f"! - FORM Logbook Edit - Error code '{lbe_commit.returncode}' with git on server for {filename}. {slug} edits saved, added to git, but NOT committed.\n"
+ msgdata
)
print(message)
diff --git a/templates/logbook2005style.html b/templates/logbook2005style.html
index 10de2d6..ce5f5bb 100644
--- a/templates/logbook2005style.html
+++ b/templates/logbook2005style.html
@@ -7,9 +7,7 @@
<meta name="keywords" content="NOEDIT">
<style>figure {font-weight: bold; font-size: small; font-family: sans-serif;font-variant-caps: small-caps;}</style>
</head>
-<!-- Exported by troggle in this format after having been imported using a different format and a different
-parser. This is because we are steadily converting old formats to a new common format so that we do not need to
-maintain half a dozen parser functions.
+<!-- Exported by troggle because one entry has been edited, and we reconstruct the whole thing.
Sorry about all the crap that surrounds the image tags which has been imported along with the content
when UK Caving blogs have been parsed.