2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 00:27:07 +00:00

Updates to make 2018 blog merge work (faster)

This commit is contained in:
2022-12-19 20:13:26 +00:00
parent 7e9bb73777
commit bb14c94ab1
5 changed files with 52 additions and 18 deletions

View File

@@ -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():