diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-07-31 01:02:02 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-07-31 01:02:02 +0300 |
commit | c1ba6a39a5f556d832da22e1f8e8ab33494f755b (patch) | |
tree | 7d136efe5a5c548ee270c9da6f4ecbba9877d6c7 /core/models | |
parent | 724234949f1770645b0f8c34221ae16b0615daf3 (diff) | |
download | troggle-c1ba6a39a5f556d832da22e1f8e8ab33494f755b.tar.gz troggle-c1ba6a39a5f556d832da22e1f8e8ab33494f755b.tar.bz2 troggle-c1ba6a39a5f556d832da22e1f8e8ab33494f755b.zip |
Wallets by year and by cave
Diffstat (limited to 'core/models')
-rw-r--r-- | core/models/survex.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/models/survex.py b/core/models/survex.py index 79a645e..a84a37e 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -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): |