2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

remove old warnings

This commit is contained in:
Philip Sargent 2024-08-05 11:08:08 +03:00
parent e97d60a1c4
commit beb83e93f4
2 changed files with 29 additions and 11 deletions

View File

@ -54,12 +54,12 @@ DEFAULT_LOGBOOK_PARSER = "parser_html"
# All years now (Jan.2023) use the default value for Logbook parser # All years now (Jan.2023) use the default value for Logbook parser
# dont forget to update expoweb/pubs.htm to match. 1982 left as reminder of expected format. # dont forget to update expoweb/pubs.htm to match. 1982 left as reminder of expected format.
LOGBOOK_PARSER_SETTINGS = { LOGBOOK_PARSER_SETTINGS = {
"1982": ("logbook.html", "parser_html"), "1982": ("logbook.html", "parser_html"),
} }
LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB
ENTRIES = { ENTRIES = {
"2024": 69, "2024": 87,
"2023": 131, "2023": 131,
"2022": 94, "2022": 94,
"2019": 55, "2019": 55,

View File

@ -2655,9 +2655,27 @@ def parse_one_file(fpath): # --------------------------------------in progress--
def set_survexblocks(): def set_survexblocks():
"""Need to find the optimal Django way of doing this query. """This sets the links directly to each survexblock.
It's a mess now""" NB ARGE inserts survexblocks from several different expeditions into one survexfile
Also a survex block e.g. "1623" will include lots of different expeditons
from models/survex.py:
name = models.CharField(max_length=100) ..often blank, no #NoName..
date = models.DateField( ..inherited
title = models.CharField(max_length=200) ..inherited
parent = models.ForeignKey("SurvexBlock"
expedition = models.ForeignKey("Expedition",
survexfile = models.ForeignKey("SurvexFile",
scanswallet = models.ForeignKey("Wallet",
legsall = models.IntegerField(null=True)
legslength = models.FloatField(null=True)
"""
# Need to find the optimal Django way of doing this query.
# It's a mess now
# for b in SurvexBlock.objects.all(): # for b in SurvexBlock.objects.all():
# if not b.date: # if not b.date:
# print(f" Block {b} on {b.survexfile} HAS NULL DATE ") # print(f" Block {b} on {b.survexfile} HAS NULL DATE ")
@ -2686,17 +2704,17 @@ def set_survexblocks():
# continue # continue
blocks = SurvexBlock.objects.filter(survexfile=sfile) blocks = SurvexBlock.objects.filter(survexfile=sfile)
for b in blocks: for b in blocks:
if b.date: # many are NULL if b.date: # many are NULL, e.g. ARGE, so have no wallet
if b.scanswallet == wallet: if b.scanswallet == wallet:
pass pass
elif b.scanswallet: elif b.scanswallet:
if b.date > date(2019, 1, 1) and b.date < date(2020, 1, 1): if b.date > date(2024, 1, 1) and b.date < date(2025, 1, 1):
print(f"not set{wallet} on {b.survexfile} : {b} as already set to {b.scanswallet}") print(f"2019 not set{wallet} on {b.survexfile} for block {b} as set explicitly to {b.scanswallet}")
else: else:
b.scanswallet = wallet b.scanswallet = wallet
b.save() b.save()
if b.date > date(2019, 1, 1) and b.date < date(2020, 1, 1): if b.date > date(2024, 1, 1) and b.date < date(2025, 1, 1):
print(f"setting {wallet} on {b.survexfile} : {b}") print(f"2019 setting {wallet} on {b.survexfile} for block {b}")
def survexifywallets(): def survexifywallets():
"""Gets the caves from the list of survexblocks """Gets the caves from the list of survexblocks