mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 19:00:56 +00:00
fixing ,, bug in logbook rewriting, and fixing persons order
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user