2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 20:37:09 +00:00

fix more twiddly variations of QMs

This commit is contained in:
2023-03-18 03:03:06 +00:00
parent d64948749e
commit 5a90e7b727
5 changed files with 59 additions and 32 deletions

View File

@@ -150,8 +150,8 @@ class QM(TroggleModel):
blockname = models.TextField(blank=True, null=True) # NB truncated copy of survexblock name with last char added
expoyear = models.CharField(max_length=4, blank=True, null=True)
ticked = models.BooleanField(default=False)
location_description = models.TextField(blank=True)
completion_description = models.TextField(blank=True)
location_description = models.TextField(blank=True, null=True)
completion_description = models.TextField(blank=True, null=True)
completion_date = models.DateField(blank=True, null=True)
nearest_station_name = models.CharField(max_length=200, blank=True, null=True)
resolution_station_name = models.CharField(max_length=200, blank=True, null=True)
@@ -177,17 +177,17 @@ class QM(TroggleModel):
blocknamestr = ""
return f"{cavestr}-{expoyearstr}-{self.number}{self.grade}{blocknamestr}"
def get_completion_url(self):
"""assumes html file named is in same folder as cave description file
WRONG - needs rewriting!"""
cd = None
if self.completion_description:
try:
dir = Path(self.cave.url).parent
cd = dir / self.completion_description
except:
cd = None
return cd
# def get_completion_url(self):
# """assumes html file named is in same folder as cave description file
# WRONG - needs rewriting!"""
# cd = None
# if self.completion_description:
# try:
# dir = Path(self.cave.url).parent
# cd = dir / self.completion_description
# except:
# cd = None
# return cd
def newslug(self):
qmslug = f"{str(self.cave)}-{self.expoyear}-{self.blockname}{self.number}{self.grade}"