mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 03:47:04 +00:00
get the survexfile path when editing a naked wallet
This commit is contained in:
@@ -26,6 +26,11 @@ and render a user-friendly error page.
|
||||
|
||||
Note that datewallet(), caveifywallet() etc do NOT save the object to the db. They are ephemeral, just for the page rendering of the
|
||||
manywallets dict.
|
||||
|
||||
TODO
|
||||
cave for a wallet - just gets the last one, randomly. SHould make this a list or many:many ideally
|
||||
|
||||
add this file in to the todo list thinggy.
|
||||
'''
|
||||
|
||||
def populatewallet(w):
|
||||
|
||||
@@ -28,7 +28,7 @@ from troggle.parsers.scans import contentsjson
|
||||
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
|
||||
from troggle.core.models.survex import DrawingFile, Wallet, SurvexBlock
|
||||
from troggle.core.views.scans import oldwallet, walletindex
|
||||
from troggle.core.views.caves import getCave
|
||||
|
||||
@@ -251,6 +251,12 @@ def scanupload(request, path=None):
|
||||
else: # no JSON file exists
|
||||
print(f'--- No JSON exists, so creating blank copy')
|
||||
waldata = WALLET_BLANK_JSON.copy()
|
||||
if not waldata["survex file"]:
|
||||
w = Wallet.objects.get(walletname=wallet)
|
||||
b = SurvexBlock.objects.filter(scanswallet=w)
|
||||
waldata["survex file"] = []
|
||||
for bsf in b:
|
||||
waldata["survex file"].append(bsf.survexfile.path)
|
||||
return waldata
|
||||
|
||||
def save_json(jsondict):
|
||||
|
||||
Reference in New Issue
Block a user