diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2022-12-19 20:13:26 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2022-12-19 20:13:26 +0000 |
commit | bb14c94ab10cbd279586c97822372bba8375b67b (patch) | |
tree | 01b251b8290e8f5a6b2784a25ca71157cbc21f88 /core/models/survex.py | |
parent | 7e9bb737771bb031d7db7864a5267b75da8e08c0 (diff) | |
download | troggle-bb14c94ab10cbd279586c97822372bba8375b67b.tar.gz troggle-bb14c94ab10cbd279586c97822372bba8375b67b.tar.bz2 troggle-bb14c94ab10cbd279586c97822372bba8375b67b.zip |
Updates to make 2018 blog merge work (faster)
Diffstat (limited to 'core/models/survex.py')
-rw-r--r-- | core/models/survex.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/models/survex.py b/core/models/survex.py index cc9b9f8..5d60e62 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -171,7 +171,8 @@ class Wallet(models.Model): ''' fpath = models.CharField(max_length=200) walletname = models.CharField(max_length=200) - + walletdate = models.DateField(blank=True, null=True) + class Meta: ordering = ('walletname',) @@ -238,6 +239,8 @@ class Wallet(models.Model): # Yes this is horribly, horribly inefficient, esp. for a page that have date, people and cave in it def date(self): + if self.walletdate: + return self.walletdate if not self.get_json(): return None jsondata = self.get_json() @@ -254,7 +257,9 @@ class Wallet(models.Model): samedate = datetime.date.fromisoformat(datestr[:10]) except: samedate = None - return samedate.isoformat() + self.walletdate = samedate.isoformat() + self.save() + return self.walletdate def people(self): if not self.get_json(): |