diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-01-30 16:42:56 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-01-30 16:42:56 +0000 |
commit | a12f666e96ecb0c63aed4e64b49d303e9e717d32 (patch) | |
tree | ba0a1e949fa0540efcd0f431fb24d6b12231aaaf /core | |
parent | ebe86d73d430b9d2d628262cf5a3539af9fd0fe7 (diff) | |
download | troggle-a12f666e96ecb0c63aed4e64b49d303e9e717d32.tar.gz troggle-a12f666e96ecb0c63aed4e64b49d303e9e717d32.tar.bz2 troggle-a12f666e96ecb0c63aed4e64b49d303e9e717d32.zip |
Remove unneeded Class ExpeditionDay
Diffstat (limited to 'core')
-rw-r--r-- | core/models/survex.py | 3 | ||||
-rw-r--r-- | core/models/troggle.py | 16 | ||||
-rw-r--r-- | core/views/logbooks.py | 15 |
3 files changed, 14 insertions, 20 deletions
diff --git a/core/models/survex.py b/core/models/survex.py index e23cd74..1903755 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -120,7 +120,6 @@ class SurvexBlock(models.Model): cave = models.ForeignKey('Cave', blank=True, null=True,on_delete=models.SET_NULL) date = models.DateField(blank=True, null=True) - #expeditionday = models.ForeignKey("ExpeditionDay", null=True,on_delete=models.SET_NULL) expedition = models.ForeignKey('Expedition', blank=True, null=True,on_delete=models.SET_NULL) survexfile = models.ForeignKey("SurvexFile", blank=True, null=True,on_delete=models.SET_NULL) @@ -162,7 +161,7 @@ class SurvexPersonRole(models.Model): personname = models.CharField(max_length=100) person = models.ForeignKey('Person', blank=True, null=True,on_delete=models.SET_NULL) personexpedition = models.ForeignKey('PersonExpedition', blank=True, null=True,on_delete=models.SET_NULL) - expeditionday = models.ForeignKey("ExpeditionDay", null=True,on_delete=models.SET_NULL) + # expeditionday = models.ForeignKey("ExpeditionDay", null=True,on_delete=models.SET_NULL) def __str__(self): return str(self.personname) + " - " + str(self.survexblock) diff --git a/core/models/troggle.py b/core/models/troggle.py index 3be7b5c..c5efa6e 100644 --- a/core/models/troggle.py +++ b/core/models/troggle.py @@ -84,14 +84,14 @@ class Expedition(TroggleModel): return urljoin(settings.URL_ROOT, reverse('expedition', args=[self.year])) -class ExpeditionDay(TroggleModel): - """Exists only on Expedition now. Removed links from logbookentry, personlogentry, survex stuff etc. - """ - expedition = models.ForeignKey("Expedition",on_delete=models.CASCADE) - date = models.DateField() - - class Meta: - ordering = ('date',) +# class ExpeditionDay(TroggleModel): + # """Exists only on Expedition now. Removed links from logbookentry, personlogentry, survex stuff etc. + # """ + # expedition = models.ForeignKey("Expedition",on_delete=models.CASCADE) + # date = models.DateField() + + # class Meta: + # ordering = ('date',) class Person(TroggleModel): diff --git a/core/views/logbooks.py b/core/views/logbooks.py index b7ad2bc..40984bf 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -103,7 +103,7 @@ def expedition(request, expeditionname): allpersonlogentries = PersonLogEntry.objects.filter(personexpedition__expedition=expo) - personexpeditiondays = [ ] + personexpodays = [ ] for personexpedition in expo.personexpedition_set.all(): expotrips = allpersonlogentries.filter(personexpedition=personexpedition) # lazy expoblocks = blocks.filter(survexpersonrole__personexpedition=personexpedition) @@ -119,12 +119,12 @@ def expedition(request, expeditionname): if issunday := (date.weekday() == 6): # WALRUS pcell["sunday"] = issunday prow.append(pcell) - personexpeditiondays.append({"personexpedition":personexpedition, "personrow":prow}) + personexpodays.append({"personexpedition":personexpedition, "personrow":prow}) ts[expeditionname] = {'expedition': expo, 'expeditions':expeditions, - 'personexpeditiondays':personexpeditiondays, 'settings':settings, + 'personexpodays':personexpodays, 'settings':settings, 'dateditems': dateditems, 'dates':dates} TROG['pagecache']['expedition'][expeditionname] = ts[expeditionname] @@ -219,15 +219,10 @@ def logbookentry(request, date, slug): jwallets = allwallets.filter(walletdate=date) for j in jwallets: wallets.add(j) - # thisexpo = Expedition.objects.get(year=int(date[0:4])) - # if thisexpo: - # #expeditionday = thisexpo.get_expedition_day(date) - # svxothers = SurvexBlock.objects.filter(date=date) - # else: - # svxothers = None + svxothers = SurvexBlock.objects.filter(date=date) this_logbookentry=this_logbookentry[0] - # This is the only page that uses personlogentry_next and personlogentry_prev + # This is the only page that uses next_.. and prev_.. # and it is calculated on the fly in the model return render(request, 'logbookentry.html', {'logbookentry': this_logbookentry, 'trips': trips, 'svxothers': svxothers, 'wallets': wallets}) |