2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 07:17:15 +00:00

Fixing inherited *date into sub-blocks

This commit is contained in:
2023-03-14 02:12:28 +00:00
parent b428a87f1a
commit 85fab88ac9
5 changed files with 55 additions and 22 deletions

View File

@@ -344,6 +344,7 @@ def svx(request, survex_file):
# collect all the survex blocks which actually have a valid date
if svxfile:
has_3d = (Path(survexdatasetpath) / Path(survex_file + ".3d")).is_file()
try:
svxblocks = svxfile.survexblock_set.filter(date__isnull=False).order_by('date')
except:
@@ -353,12 +354,14 @@ def svx(request, survex_file):
svxlength = 0.0
for b in svxblocksall:
svxlength += b.legslength
print(svxlength,b, b.legsall)
# print(svxlength,b, b.legsall)
except AttributeError: # some survexfiles just *include files and have no blocks themselves
svxblocksall = []
else:
svxblocks = []
svxblocksall = []
svxlength = 0.0
has_3d = False
if not difflist:
difflist = ["Survex file does not exist yet"]
@@ -368,7 +371,7 @@ def svx(request, survex_file):
vmap = {
"settings": settings,
"warning": warning,
"has_3d": (Path(survexdatasetpath) / Path(survex_file + ".3d")).is_file(),
"has_3d": has_3d,
"title": survex_file,
"svxlength": svxlength,
"svxblocks": svxblocks,