Renaming class step 2

This commit is contained in:
2023-01-30 16:18:19 +00:00
parent 58f7cf72d4
commit b29ff61871
12 changed files with 22 additions and 29 deletions

View File

@@ -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 = [ ]