diff --git a/core/views/uploads.py b/core/views/uploads.py index 36ccd20..6eaadc6 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -31,7 +31,7 @@ from troggle.core.models.troggle import DataIssue from troggle.core.models.troggle import Expedition, Person, PersonExpedition from troggle.core.models.caves import LogbookEntry, QM, Cave, PersonTrip from troggle.core.models.survex import DrawingFile, Wallet, SurvexBlock, SurvexFile, SurvexPersonRole -from troggle.core.views.scans import oldwallet +from troggle.core.views.scans import oldwallet, caveifywallet from troggle.core.views.caves import getCave @@ -324,6 +324,7 @@ def scanupload(request, path=None): except: print(f'!-- Wallet string {walletname}, FAIL TO GET or create WALLET OBJECT') raise + return w def commit_json(waldata): destfolder = contents_path.parent @@ -441,7 +442,7 @@ def scanupload(request, path=None): #print(f'--- {wd["survex file"]} - {type(wd["survex file"])}') save_json(wd) - make_wallet(wallet) + walletobject = make_wallet(wallet) commit_json(wd) else: @@ -479,7 +480,7 @@ def scanupload(request, path=None): filesaved = True #print(f'--- FORM scanupload multiple BUT EMPTY METADATA supposedly {WALLET_BLANK_JSON["date"]=}') save_json(waldata) - make_wallet(wallet) + walletobject = make_wallet(wallet) commit_json(waldata) # # Not a POST, so a GET starts here. And also control gets here after a POST is processed. @@ -676,10 +677,16 @@ def scanupload(request, path=None): survexsize = str(min(len(str(waldata["survex file"])), 46)) + thiswallet = Wallet.objects.get(walletname=wallet) + caveifywallet(thiswallet) + thiswallet.ticks = thiswallet.get_ticks() # the complaints in colour form + #fixsurvextick(thiswallet, thiswallet.ticks) + print(thiswallet) context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty, 'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles, 'checked': checked, 'trips': trips, + 'manywallets': [thiswallet], 'svxothers': svxothers, 'create': create, 'metadataurl': metadataurl, 'complaints': complaints, @@ -693,7 +700,7 @@ def scanupload(request, path=None): #'url': waldata["description url"], 'urlsize': str(len(str(waldata["description url"]))), 'survex': waldata["survex file"], 'survexsize': survexsize, 'cave': cave, 'psg': psg, 'freetext': freetext,'psgsize': str(max(12,len(str(psg)))), 'freetextsize': str(max(60,len(str(freetext))))}) - else: # no wallet data: should never happen as their should be default data in all cases + else: # no wallet data: should never happen as there should be default data in all cases context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty, 'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles, 'checked': checked, diff --git a/templates/cavewallets.html b/templates/cavewallets.html index 6a2fd7c..9a65d28 100644 --- a/templates/cavewallets.html +++ b/templates/cavewallets.html @@ -21,6 +21,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c | {{otherexpedition.year}} {% endfor %} {% include 'wallet_table.html' %} +
Note that names in italics are copied from the related survex file block name.
Wallet | Wallet Date | Wallet Name | People | Scans | Survex blocks | Drawings using these scans |
---|