summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-07-30 00:53:24 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2024-07-30 00:53:24 +0300
commit62320e9f7ea09ffb0407d3abdea8b12a75908eed (patch)
tree4d2f524be169143b59cf7b876fc90015b2df52b8 /core
parent526d0ad90435f8701069dff3dd7b07002feead15 (diff)
downloadtroggle-62320e9f7ea09ffb0407d3abdea8b12a75908eed.tar.gz
troggle-62320e9f7ea09ffb0407d3abdea8b12a75908eed.tar.bz2
troggle-62320e9f7ea09ffb0407d3abdea8b12a75908eed.zip
fixing ,, bug in logbook rewriting, and fixing persons order
Diffstat (limited to 'core')
-rw-r--r--core/models/logbooks.py6
-rw-r--r--core/models/troggle.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/core/models/logbooks.py b/core/models/logbooks.py
index 37d6cb1..326a097 100644
--- a/core/models/logbooks.py
+++ b/core/models/logbooks.py
@@ -76,17 +76,17 @@ class LogbookEntry(TroggleModel):
return index
def writelogbook(year, filename):
+ """Writes all the database logbook entries into a new logbook.html file
+ """
current_expedition = Expedition.objects.get(year=year)
logbook_entries = LogbookEntry.objects.filter(expedition=current_expedition).order_by(
"slug"
) # now that slug, aka tripid, is in our standard date form, this will preserve ordering.
print(f" - Logbook to be exported has {len(logbook_entries)} entries in it.")
-
- template = "logbook2005style.html"
try:
- t = loader.get_template(template)
+ t = loader.get_template("logbook2005style.html")
logbookfile = t.render({"logbook_entries": logbook_entries})
except:
print(" ! Very Bad Error RENDERING template " + template)
diff --git a/core/models/troggle.py b/core/models/troggle.py
index c2a88db..89e6e00 100644
--- a/core/models/troggle.py
+++ b/core/models/troggle.py
@@ -161,7 +161,7 @@ class PersonExpedition(TroggleModel):
# is_guest = models.BooleanField(default=False) # This is per-Person, not per-PersonExpedition
class Meta:
- ordering = ("-expedition",)
+ ordering = ("-expedition", "-person")
# order_with_respect_to = 'expedition'
def __str__(self):