summaryrefslogtreecommitdiffstats
path: root/core/views/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/survex.py')
-rw-r--r--core/views/survex.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/views/survex.py b/core/views/survex.py
index 0255559..9507795 100644
--- a/core/views/survex.py
+++ b/core/views/survex.py
@@ -296,6 +296,7 @@ def svx(request, survex_file):
svxincludes = re.findall(r"(?i)\*include\s+(\S+)", form.data["code"] or "")
svxfile = form.survexfile # only valid once form.GetDiscCode() called
+ print(f"{svxfile=}")
try:
svxblocksall = svxfile.survexblock_set.all()
except AttributeError: # some survexfiles just *include files and have no blocks themselves
@@ -304,13 +305,14 @@ def svx(request, survex_file):
for b in svxblocksall:
if b.date:
svxblocks.append(b)
- print(f"{svxfile=} {svxblocks}")
+ print(f"- {b}")
# collect all the stuff that happens on the same dates as the survex blocks
dates = set()
for b in svxblocks:
dates.add(b.date)
+ print(f"- {b.date}")
events = events_on_dates(dates)
vmap = {
@@ -323,6 +325,7 @@ def svx(request, survex_file):
"difflist": difflist,
"logmessage": logmessage,
"form": form,
+ "events": events,
}
# vmap.update(csrf(request)) # this now refreshes to the wrong value, now that we user render(request,
@@ -337,7 +340,6 @@ def events_on_dates(dates):
"""Returns a dictionary of indexed by date. For each date there is a named tuple of 3 lists:
logbookentries, survexfiles (NB files, not blocks), and wallets.
"""
- print(dates)
events = {}
for d in dates:
trips = LogbookEntry.objects.filter(date=d)
@@ -350,6 +352,7 @@ def events_on_dates(dates):
refwallets = allwallets.filter(survexblock__date=d)
events[d] = SameDateEvents(trips=trips, svxfiles=svxfiles, wallets=refwallets)
+ print(events)
return events
# The cavern running function. This is NOT where it is run inside the form! see SvxForm.Process() for that