diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2022-12-18 19:33:56 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2022-12-18 19:33:56 +0000 |
commit | d1b94763b43842e7834062a2ab68978c6d95a95e (patch) | |
tree | 40c35912341c838fe65d8cd4f81d1207b4418e71 /core/models/caves.py | |
parent | 73b710d53f0ea4fb4c1693679732e19a53530d1d (diff) | |
download | troggle-d1b94763b43842e7834062a2ab68978c6d95a95e.tar.gz troggle-d1b94763b43842e7834062a2ab68978c6d95a95e.tar.bz2 troggle-d1b94763b43842e7834062a2ab68978c6d95a95e.zip |
Fixing wiki-parsing for 2009 logbook
Diffstat (limited to 'core/models/caves.py')
-rw-r--r-- | core/models/caves.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index 30a4a0b..6f56cab 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -453,10 +453,6 @@ class Entrance(TroggleModel): class LogbookEntry(TroggleModel): """Single parsed entry from Logbook - - But what is all this__getattribute__ meta stuff for ? When is it needed ?!? - Le'ts get rid of it and set the 'cave' attribute to a cave object elsehwhere. This is - attempting to be Too Clever. """ date = models.DateField()#MJG wants to turn this into a datetime such that multiple Logbook entries on the same day can be ordered.ld() expeditionday = models.ForeignKey("ExpeditionDay", null=True,on_delete=models.SET_NULL)#MJG wants to KILL THIS (redundant information) @@ -466,13 +462,14 @@ class LogbookEntry(TroggleModel): place = models.CharField(max_length=100,blank=True, null=True,help_text="Only use this if you haven't chosen a cave") text = models.TextField() slug = models.SlugField(max_length=50) + time_underground = models.FloatField(null=True,help_text="In decimal hours") class Meta: verbose_name_plural = "Logbook Entries" # several PersonTrips point in to this object ordering = ('-date',) - def cave(self): # Why didn't he just make this a foreign key to Cave ? Replaces __getattrribute__ sillyness. + def cave(self): # Why didn't he just make this a foreign key to Cave ? c = CaveSlug.objects.get(slug=self.cave_slug, primary=True).cave return c @@ -491,18 +488,6 @@ class LogbookEntry(TroggleModel): def get_previous_by_id(self): LogbookEntry.objects.get(id=self.id-1) - # def new_QM_number(self): - # """Returns """ - # if self.cave: - # nextQMnumber=self.cave.new_QM_number(self.date.year) - # else: - # return None - # return nextQMnumber - - # def new_QM_found_link(self): - # """Produces a link to a new QM with the next number filled in and this LogbookEntry set as 'found by' """ - # return settings.URL_ROOT + r'/admin/core/qm/add/?' + r'found_by=' + str(self.pk) +'&number=' + str(self.new_QM_number()) - def DayIndex(self): return list(self.expeditionday.logbookentry_set.all()).index(self) |