2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 14:21:27 +00:00

SHould be nearly working, but crashes on saving edited entry

This commit is contained in:
2025-11-26 01:22:38 +02:00
parent 0e6a3e457d
commit ced9a7b024
13 changed files with 187 additions and 98 deletions

View File

@@ -107,7 +107,31 @@ class LogbookEntry(TroggleModel):
index = index % mx
return index
def writelogbook(year, filename):
READ_THIS="""<!--
READTHIS
###### #######
# # ###### ## ##### # # # # ####
# # # # # # # # # # # #
###### ##### # # # # # ###### # ####
# # # ###### # # # # # # #
# # # # # # # # # # # # #
# # ###### # # ##### # # # # ####
THIS FILE IS NOT THE MASTER.
ANY EDITS YOU MAKE HERE WILL BE OVERWRITTEN.
The MASTER record for this expo is the individual JSON files in
expoweb/years/2025/log_entries/*.json
In due course, when this expo is archived, the JSON files will be deleted
and this file will beocme the master again, and this warning will be deleted.
Meanwhile, use the online logbook entry editor to make changes.
READTHIS
-->
"""
def writelogbook(year, filename, generate_on_view=False):
"""Writes all the database logbook entries into a new logbook.html file
"""
current_expedition = Expedition.objects.get(year=year)
@@ -140,6 +164,9 @@ def writelogbook(year, filename):
except:
print(" ! Very Bad Error opening " + endpath)
raise
if generate_on_view:
endmatter += READ_THIS
except:
print(" ! FAIL endpath " + endpath)
raise