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): diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 54f4f56..ef2668a 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -59,11 +59,11 @@ LOGBOOK_PARSER_SETTINGS = { LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB ENTRIES = { - "2024": 41, - "2023": 112, + "2024": 69, + "2023": 131, "2022": 94, "2019": 55, - "2018": 95, + "2018": 98, "2017": 74, "2016": 87, "2015": 80, diff --git a/templates/logbook2005style.html b/templates/logbook2005style.html index a1aeb67..10de2d6 100644 --- a/templates/logbook2005style.html +++ b/templates/logbook2005style.html @@ -22,7 +22,7 @@ See troggle/code/views/other.py and core.models/logbooks.py writelogbook(year, f
{{logbook_entry.date|date:'Y-m-d'}}
-
{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %},{% endif %}{% endfor %}{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}{% else %}{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %}{% endif %},{% endfor %}{% if logbook_entry.other_people %}, {{logbook_entry.other_people}}{% endif %}
+
{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %},{% endif %}{% endfor %}{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}{% else %}{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %},{% endif %}{% endfor %}{% if logbook_entry.other_people %}, {{logbook_entry.other_people}}{% endif %}
{{logbook_entry.title|safe}}
{{logbook_entry.text|safe}}
T/U: {{logbook_entry.time_underground|safe}} hours