summaryrefslogtreecommitdiffstats
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
parent526d0ad90435f8701069dff3dd7b07002feead15 (diff)
downloadtroggle-62320e9f7ea09ffb0407d3abdea8b12a75908eed.tar.gz
troggle-62320e9f7ea09ffb0407d3abdea8b12a75908eed.tar.bz2
troggle-62320e9f7ea09ffb0407d3abdea8b12a75908eed.zip
fixing ,, bug in logbook rewriting, and fixing persons order
-rw-r--r--core/models/logbooks.py6
-rw-r--r--core/models/troggle.py2
-rw-r--r--parsers/logbooks.py6
-rw-r--r--templates/logbook2005style.html2
4 files changed, 8 insertions, 8 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):
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
<hr />
<div class="tripdate" id="{{logbook_entry.slug}}">{{logbook_entry.date|date:'Y-m-d'}}</div>
-<div class="trippeople">{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}<u>{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %}</u>,{% 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 %}</div>
+<div class="trippeople">{% for personlogentry in logbook_entry.personlogentry_set.all %}{% if personlogentry.is_logbook_entry_author %}<u>{% if personlogentry.nickname_used %}{{personlogentry.nickname_used|safe}}{% else %}{{personlogentry.personexpedition.person|safe}}{% endif %}</u>,{% 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 %}</div>
<div class="triptitle">{{logbook_entry.title|safe}}</div>
{{logbook_entry.text|safe}}
<div class="timeug">T/U: {{logbook_entry.time_underground|safe}} hours</div>