forked from expo/troggle
bugfixes
This commit is contained in:
parent
38eb65ac0e
commit
31b912f3ca
@ -47,16 +47,16 @@ class Area(TroggleModel):
|
|||||||
super = models.ForeignKey('Area', blank=True, null=True, on_delete=models.SET_NULL)
|
super = models.ForeignKey('Area', blank=True, null=True, on_delete=models.SET_NULL)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.parent:
|
if self.super:
|
||||||
return str(self.parent) + " - " + str(self.short_name)
|
return str(self.super) + " - " + str(self.short_name)
|
||||||
else:
|
else:
|
||||||
return str(self.short_name)
|
return str(self.short_name)
|
||||||
|
|
||||||
def kat_area(self):
|
def kat_area(self):
|
||||||
if self.short_name in ["1623", "1626", "1624", "1627"]:
|
if self.short_name in ["1623", "1626", "1624", "1627"]:
|
||||||
return self.short_name
|
return self.short_name
|
||||||
elif self.parent:
|
elif self.super:
|
||||||
return self.parent.kat_area()
|
return self.super.kat_area()
|
||||||
|
|
||||||
class CaveAndEntrance(models.Model):
|
class CaveAndEntrance(models.Model):
|
||||||
cave = models.ForeignKey('Cave',on_delete=models.CASCADE)
|
cave = models.ForeignKey('Cave',on_delete=models.CASCADE)
|
||||||
|
@ -69,6 +69,7 @@ def chaosmonkey(n):
|
|||||||
#
|
#
|
||||||
def GetListDir(sdir):
|
def GetListDir(sdir):
|
||||||
'''handles url or file, so we can refer to a set of scans (not drawings) on another server
|
'''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 = [ ]
|
res = [ ]
|
||||||
if type(sdir) is str and sdir[:7] == "http://":
|
if type(sdir) is str and sdir[:7] == "http://":
|
||||||
|
@ -105,7 +105,7 @@ def load_all_scans():
|
|||||||
# do the year folders
|
# do the year folders
|
||||||
if re.match(r"\d\d\d\d$", walletname):
|
if re.match(r"\d\d\d\d$", walletname):
|
||||||
print(f"{walletname}", end=' ')
|
print(f"{walletname}", end=' ')
|
||||||
for walletname, fpath, fisdir in GetListDir(ff):
|
for walletname, fpath, fisdir in GetListDir(fpath):
|
||||||
if fisdir:
|
if fisdir:
|
||||||
wallet = Wallet(fpath=fpath, walletname=walletname)
|
wallet = Wallet(fpath=fpath, walletname=walletname)
|
||||||
# this is where we should load the contents.json for people so we can report on them later
|
# 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?
|
# what is this?
|
||||||
elif walletname != "thumbs":
|
elif walletname != "thumbs":
|
||||||
print(f'\n - Wallet {f} - {ff}')
|
print(f'\n - Wallet {walletname} - {fpath}')
|
||||||
wallet = Wallet(fpath=fpath, walletname=walletname)
|
wallet = Wallet(fpath=fpath, walletname=walletname)
|
||||||
wallet.save()
|
wallet.save()
|
||||||
LoadListScansFile(wallet)
|
LoadListScansFile(wallet)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% load link %}
|
{% load link %}
|
||||||
{% block title %} QM: {{qm|safe}} {% endblock %}
|
{% block title %} QM: {{qm|safe}} {% endblock %}
|
||||||
{% block contentheader %}
|
{% 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 .
|
<p>Note that QMs loaded for 1623-161, 1623-204 and 1623-234 are imported from CSV files .
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user