summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/models/caves.py8
-rw-r--r--core/utils.py1
-rw-r--r--parsers/scans.py4
-rw-r--r--templates/cave_qms.html2
4 files changed, 8 insertions, 7 deletions
diff --git a/core/models/caves.py b/core/models/caves.py
index 92255bb..3fae7f4 100644
--- a/core/models/caves.py
+++ b/core/models/caves.py
@@ -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)
diff --git a/core/utils.py b/core/utils.py
index c9afdd5..9aa4679 100644
--- a/core/utils.py
+++ b/core/utils.py
@@ -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://":
diff --git a/parsers/scans.py b/parsers/scans.py
index 3d81f13..fdded82 100644
--- a/parsers/scans.py
+++ b/parsers/scans.py
@@ -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)
diff --git a/templates/cave_qms.html b/templates/cave_qms.html
index a9cab3c..c1ae81f 100644
--- a/templates/cave_qms.html
+++ b/templates/cave_qms.html
@@ -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 .