This commit is contained in:
Philip Sargent 2022-07-22 12:40:42 +03:00
parent 38eb65ac0e
commit 31b912f3ca
4 changed files with 8 additions and 7 deletions

View File

@ -47,16 +47,16 @@ class Area(TroggleModel):
super = models.ForeignKey('Area', blank=True, null=True, on_delete=models.SET_NULL)
def __str__(self):
if self.parent:
return str(self.parent) + " - " + str(self.short_name)
if self.super:
return str(self.super) + " - " + str(self.short_name)
else:
return str(self.short_name)
def kat_area(self):
if self.short_name in ["1623", "1626", "1624", "1627"]:
return self.short_name
elif self.parent:
return self.parent.kat_area()
elif self.super:
return self.super.kat_area()
class CaveAndEntrance(models.Model):
cave = models.ForeignKey('Cave',on_delete=models.CASCADE)

View File

@ -69,6 +69,7 @@ def chaosmonkey(n):
#
def GetListDir(sdir):
'''handles url or file, so we can refer to a set of scans (not drawings) on another server
returns a list of f (file), ff (file full path), is_dir (bool)
'''
res = [ ]
if type(sdir) is str and sdir[:7] == "http://":

View File

@ -105,7 +105,7 @@ def load_all_scans():
# do the year folders
if re.match(r"\d\d\d\d$", walletname):
print(f"{walletname}", end=' ')
for walletname, fpath, fisdir in GetListDir(ff):
for walletname, fpath, fisdir in GetListDir(fpath):
if fisdir:
wallet = Wallet(fpath=fpath, walletname=walletname)
# this is where we should load the contents.json for people so we can report on them later
@ -116,7 +116,7 @@ def load_all_scans():
# what is this?
elif walletname != "thumbs":
print(f'\n - Wallet {f} - {ff}')
print(f'\n - Wallet {walletname} - {fpath}')
wallet = Wallet(fpath=fpath, walletname=walletname)
wallet.save()
LoadListScansFile(wallet)

View File

@ -2,7 +2,7 @@
{% load link %}
{% block title %} QM: {{qm|safe}} {% endblock %}
{% block contentheader %}
<h2>Question marks for {{cave.kataster_number}} - {{cave.official_name|safe}} - {{cave.unofficial_number}}</h2>
<h2>Question marks for <a href="/{{cave.url}}">{{cave.kataster_number}} - {{cave.official_name|safe}}</a> - {{cave.unofficial_number}}</h2>
<p>Note that QMs loaded for 1623-161, 1623-204 and 1623-234 are imported from CSV files .