Wallets by year and by cave

This commit is contained in:
Philip Sargent
2022-07-31 01:02:02 +03:00
parent 724234949f
commit c1ba6a39a5
7 changed files with 110 additions and 13 deletions

View File

@@ -190,6 +190,16 @@ class Wallet(models.Model):
raise
return waldata
def year(self):
if self.walletname[4] != "#":
return None
year = int(self.walletname[0:4])
if year < 1976 or year > 2050:
return None
else:
return str(year)
# Yes this is horribly, horribly inefficient, esp. for a page that have date, people and cave in it
def date(self):