2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

remove URL field from wallet as seen and edited

This commit is contained in:
Philip Sargent 2022-09-19 20:55:34 +03:00
parent d2c6c4d7fb
commit 2648bada30
3 changed files with 18 additions and 21 deletions

View File

@ -61,7 +61,7 @@ todo = '''
WALLET_BLANK_JSON = {
"cave": "",
"date": "",
"description url": "1623/NNN",
# "description url": "1623/NNN",
"description written": False,
"electronic survey": False,
"elev drawn": False,
@ -104,10 +104,11 @@ class WalletForm(forms.Form): # not a model-form, just a form-form
electronic = forms.CharField(strip=True, required=False)
pland = forms.CharField(strip=True, required=False)
elevd = forms.CharField(strip=True, required=False)
url = forms.CharField(strip=True, required=False)
#url = forms.CharField(strip=True, required=False)
survex = forms.CharField(strip=True, required=False)
xlate = {"url": "description url",
xlate = {
# "url": "description url",
"descriptionw": "description written",
"people": "people",
"date": "date",
@ -200,15 +201,15 @@ def get_complaints(complaints, waldata, svxfiles, files, wallet, wurl):
if not waldata["website updated"]:
complaints.append("The cave description website is marked as needing updating using the guidebook description from the survex file. Tick the 'Website updated' checkbox when this is done.")
# FInd the cave, if it exists
# Find the cave, if it exists
if waldata["cave"]:
try:
caveid = waldata["cave"]
caveid = caveid.replace("/","-")
caveobject = getCave(caveid)
print(f'getCave for id "{waldata["cave"]}" {caveobject}')
if not caveobject.url == waldata["description url"]:
complaints.append(f'The URL of cave description \"{waldata["description url"]}\" does not match the one on record for this cave which is: "{caveobject.url}". If the wallet is not for a cave, put a useful URL here.')
# if not caveobject.url == waldata["description url"]:
# complaints.append(f'The URL of cave description \"{waldata["description url"]}\" does not match the one on record for this cave which is: "{caveobject.url}". If the wallet is not for a cave, put a useful URL here.')
except Cave.MultipleObjectsReturned:
complaints.append(f'The cave ID \'{waldata["cave"]}\' is AMBIGUOUS. Please fix it.')
caveobject = None
@ -531,6 +532,7 @@ def scanupload(request, path=None):
return render(request, 'errors/generic.html', {'message': message})
print(f' - {svxfile=}')
if svxfile.cave:
caves.append(svxfile.cave)
caverefs.append(svxfile.cave.reference())
blocks = SurvexBlock.objects.filter(survexfile= svxfile)
@ -563,14 +565,14 @@ def scanupload(request, path=None):
if len(caverefs) == 1:
waldata["cave"] = caverefs[0]
print(f' - Setting wallet cave to {caverefs[0]}')
waldata["description url"] = caves[0]
# waldata["description url"] = caves[0]
elif len(caverefs) == 0:
waldata["cave"] = ""
waldata["description url"] = ""
# waldata["description url"] = ""
print(f' - No caves in this wallet {wallet}. ')
else:
waldata["cave"] = "several caves"
waldata["description url"] = "several.."
# waldata["description url"] = "several.."
print(f' - More than one Cave {caves} in this wallet {wallet}. Not managed in this troggle release.')
if len(names) == 1:
if waldata["name"] == '':
@ -589,8 +591,8 @@ def scanupload(request, path=None):
cave = ""
if waldata["name"]:
psg = waldata["name"]
if not waldata["description url"]:
waldata["description url"]=""
# if not waldata["description url"]:
# waldata["description url"]=""
# find trips and survex files of the same date
if waldata["date"]:
@ -641,7 +643,7 @@ def scanupload(request, path=None):
return render(request, 'walletform.html',
{'form': form, 'wallet': wallet, **context,
'date': waldata["date"],
'url': waldata["description url"], 'urlsize': str(len(str(waldata["description url"]))),
#'url': waldata["description url"], 'urlsize': str(len(str(waldata["description url"]))),
'survex': waldata["survex file"], 'survexsize': survexsize,
'cave': cave, 'psg': psg, 'psgsize': str(max(12,len(str(psg))))})
else: # no wallet data: should never happen as their should be default data in all cases

View File

@ -884,7 +884,7 @@ class LoadingSurvex():
team = self.rx_commteam.match(comment)
if team:
print(f'rx_commteam -- {comment=} in {survexblock.survexfile.path} :: {survexblock}')
# print(f'rx_commteam -- {comment=} in {survexblock.survexfile.path} :: {survexblock}')
pass
qml = self.rx_qm0.match(comment)

View File

@ -179,12 +179,7 @@
label = "People" name = "people" size ="{{peoplesize}}"
title="List of people on the survey trip"
placeholder="{{people}}" value="{{people}}" />
<br>
<label for="url">URL of survey area (only needed if not a cave)</label>
<input
label = "URL" name = "url" size ="{{urlsize}}"
title="URL of cave description, e.g. /1623/264/264.html"
placeholder="{{url}}" value="{{url}}" />
<br>
<label for="survex">List of survex files</label>
<input