summaryrefslogtreecommitdiffstats
path: root/core/models/logbooks.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-01-30 16:18:19 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-01-30 16:18:19 +0000
commitb29ff618718f4d28ae4e5ae338ef0cf7dfb764b9 (patch)
tree3fbbb69224491cc6feca4e31e1f0944b6263fe51 /core/models/logbooks.py
parent58f7cf72d48a89e3bfe32bbde6b47f263121e232 (diff)
downloadtroggle-b29ff618718f4d28ae4e5ae338ef0cf7dfb764b9.tar.gz
troggle-b29ff618718f4d28ae4e5ae338ef0cf7dfb764b9.tar.bz2
troggle-b29ff618718f4d28ae4e5ae338ef0cf7dfb764b9.zip
Renaming class step 2
Diffstat (limited to 'core/models/logbooks.py')
-rw-r--r--core/models/logbooks.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/models/logbooks.py b/core/models/logbooks.py
index 19cd33d..6070003 100644
--- a/core/models/logbooks.py
+++ b/core/models/logbooks.py
@@ -25,11 +25,10 @@ from troggle.core.models.survex import SurvexStation
from troggle.core.models.troggle import (DataIssue, Expedition, Person,
PersonExpedition, TroggleModel)
-'''The model declarations LogBookEntry, PersonTrip, QM
+'''The model declarations LogBookEntry, PersonLogEntry, QM
'''
todo='''
-- Rename PersonTrip as PersonLogEntry or similar
'''
class CaveSlug(models.Model):
@@ -52,7 +51,7 @@ class LogbookEntry(TroggleModel):
class Meta:
verbose_name_plural = "Logbook Entries"
- # several PersonTrips point in to this object
+ # several PersonLogEntrys point in to this object
ordering = ('-date',)
def cave(self): # Why didn't he just make this a foreign key to Cave ?
@@ -91,7 +90,7 @@ class LogbookEntry(TroggleModel):
return index
-class PersonTrip(TroggleModel):
+class PersonLogEntry(TroggleModel):
"""Single Person going on a trip, which may or may not be written up.
It could account for different T/U for people in same logbook entry.
"""
@@ -105,14 +104,14 @@ class PersonTrip(TroggleModel):
#order_with_respect_to = 'personexpedition'
def next_personlog(self):
- futurePTs = PersonTrip.objects.filter(personexpedition = self.personexpedition, logbook_entry__date__gt = self.logbook_entry.date).order_by('logbook_entry__date').all()
+ futurePTs = PersonLogEntry.objects.filter(personexpedition = self.personexpedition, logbook_entry__date__gt = self.logbook_entry.date).order_by('logbook_entry__date').all()
if len(futurePTs) > 0:
return futurePTs[0]
else:
return None
def prev_personlog(self):
- pastPTs = PersonTrip.objects.filter(personexpedition = self.personexpedition, logbook_entry__date__lt = self.logbook_entry.date).order_by('-logbook_entry__date').all()
+ pastPTs = PersonLogEntry.objects.filter(personexpedition = self.personexpedition, logbook_entry__date__lt = self.logbook_entry.date).order_by('-logbook_entry__date').all()
if len(pastPTs) > 0:
return pastPTs[0]
else: