2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-12-12 03:22:18 +00:00

preserving expoer order in logbook entries attempt 1

This commit is contained in:
Philip Sargent 2024-12-10 20:09:25 +00:00
parent 700512c008
commit 8c56a45e7c
3 changed files with 9 additions and 8 deletions

View File

@ -136,8 +136,8 @@ def writelogbook(year, filename):
# print(f'Logbook exported to {filepath}') # print(f'Logbook exported to {filepath}')
class PersonLogEntry(TroggleModel): class PersonLogEntry(TroggleModel):
"""Single Person going on a trip, which may or may not be written up. """Single Person going on a trip.
It could account for different T/U for people in same logbook entry. In future it could account for different T/U for people in same logbook entry.
CASCADE means that if the personexpedition or the logbookentry is deleted, CASCADE means that if the personexpedition or the logbookentry is deleted,
then this PersonLogEntry is deleted too then this PersonLogEntry is deleted too
@ -150,8 +150,11 @@ class PersonLogEntry(TroggleModel):
nickname_used = models.CharField(max_length=100,default="") # e.g. "Animal" or "Zonker", as it appears in the original logbook nickname_used = models.CharField(max_length=100,default="") # e.g. "Animal" or "Zonker", as it appears in the original logbook
class Meta: class Meta:
ordering = ("-personexpedition",) ordering = ("nickname_used", "-personexpedition")
# order_with_respect_to = 'personexpedition' # order_with_respect_to = 'personexpedition' and then with nickname
# within the same logbook entry (which will always be the same expedition) this will
# now not re-order the participants in a trip every time we save the logbook.
# but this does not work.. need a function
def next_personlog(self): def next_personlog(self):
futurePTs = ( futurePTs = (

View File

@ -7,9 +7,7 @@
<meta name="keywords" content="NOEDIT"> <meta name="keywords" content="NOEDIT">
<style>figure {font-weight: bold; font-size: small; font-family: sans-serif;font-variant-caps: small-caps;}</style> <style>figure {font-weight: bold; font-size: small; font-family: sans-serif;font-variant-caps: small-caps;}</style>
</head> </head>
<!-- Exported by troggle in this format after having been imported using a different format and a different <!-- Exported by troggle because one entry has been edited, and we reconstruct the whole thing.
parser. This is because we are steadily converting old formats to a new common format so that we do not need to
maintain half a dozen parser functions.
Sorry about all the crap that surrounds the image tags which has been imported along with the content Sorry about all the crap that surrounds the image tags which has been imported along with the content
when UK Caving blogs have been parsed. when UK Caving blogs have been parsed.