summaryrefslogtreecommitdiffstats
path: root/core/models
diff options
context:
space:
mode:
Diffstat (limited to 'core/models')
-rw-r--r--core/models/survex.py10
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):