From b29ff618718f4d28ae4e5ae338ef0cf7dfb764b9 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 30 Jan 2023 16:18:19 +0000 Subject: Renaming class step 2 --- core/views/logbooks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/views/logbooks.py') diff --git a/core/views/logbooks.py b/core/views/logbooks.py index 47aa7e1..4daede9 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -14,7 +14,7 @@ from django.utils import timezone from django.views.generic.list import ListView import troggle.settings as settings -from troggle.core.models.logbooks import LogbookEntry, PersonTrip +from troggle.core.models.logbooks import LogbookEntry, PersonLogEntry from troggle.core.models.survex import SurvexBlock from troggle.core.models.troggle import Expedition, Person, PersonExpedition from troggle.core.models.wallets import Wallet @@ -64,8 +64,8 @@ def expedition(request, expeditionname): Remember that 'personexpedition__expedition' is interpreted by Django to mean the 'expedition' object which is connected by a foreign key to the 'personexpedition' - object, which is a field of the PersonTrip object: - PersonTrip.objects.filter(personexpedition__expedition=expo) + object, which is a field of the PersonLogEntry object: + PersonLogEntry.objects.filter(personexpedition__expedition=expo) Queries are not evaluated to hit the database until a result is actually used. Django does lazy evaluation. @@ -100,7 +100,7 @@ def expedition(request, expeditionname): dateditems = list(entries) + list(blocks) # evaluates the Django query and hits db dates = sorted(set([item.date for item in dateditems])) - allpersonlogentries = PersonTrip.objects.filter(personexpedition__expedition=expo) + allpersonlogentries = PersonLogEntry.objects.filter(personexpedition__expedition=expo) personexpeditiondays = [ ] -- cgit v1.2.3