Populate blank wallet fields with survex data

This commit is contained in:
Philip Sargent
2022-07-29 20:55:19 +03:00
parent bc3da1182b
commit 724234949f
3 changed files with 69 additions and 10 deletions

View File

@@ -191,6 +191,7 @@ class Wallet(models.Model):
return waldata
# Yes this is horribly, horribly inefficient, esp. for a page that have date, people and cave in it
def date(self):
jsondata = self.get_json()
return jsondata["date"]
@@ -199,12 +200,16 @@ class Wallet(models.Model):
jsondata = self.get_json()
return jsondata["people"]
def cave(self):
jsondata = self.get_json()
return jsondata["cave"]
def name(self):
jsondata = self.get_json()
return jsondata["name"]
def __str__(self):
return str(self.walletname) + " (Wallet)"
return "[" + str(self.walletname) + " (Wallet)]"
class SingleScan(models.Model):
ffile = models.CharField(max_length=200)