diff --git a/core/models/caves.py b/core/models/caves.py index 883e33c..d13ad70 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -26,13 +26,13 @@ Gcave_count = None todo = """ - Find out why we have separate objects CaveSlug and why - these are not just a single field on the Model. Do we ever need more - than one slug per cave or entrance? Surely that would break everything?? + these are not just a single field on the Model. This was Martin's idea, + but we are using text aliases now so we only need one slug in the data model - Can we rewrite things to eliminate the CaveSlug and objects? Surely foreign keys work fine ?! -- Why do we have CaveAndEntrance objects ? Surely entranceletter belongs on the Entrance object? +- Why do we have CaveAndEntrance objects ? - move the aliases list from the code and put into an editable file @@ -644,8 +644,7 @@ def GetCaveLookup(): ("tempest", "1623-2023-lc-01"), ("1623-2023-kt-02", "2023-kt-02"), - #("1623-2023-jss-01", "2023-jss-01"), - + # 1626 aliases ("langgustl", "1626-354"), ("2018-dm-07", "1626-359"), @@ -691,6 +690,8 @@ def GetCaveLookup(): ldup = [] for d in duplicates: + # if an alias resolves to 2 or more caves, remove it as an alias + # NOTE such an alisas is restored, assuming a 1623 area, when parsing Wallets - but only wallets. Gcavelookup.pop(d) Gcave_count.pop(d) # so should not get a duplicate msg below.. ldup.append(d) diff --git a/core/views/caves.py b/core/views/caves.py index 8adf0d6..15f0fda 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -32,8 +32,6 @@ Manages the use of cavern to parse survex files to produce 3d and pos files """ todo = """ -- Fix rendercave() so that CaveView works - - in getCaves() search GCavelookup first, which should raise a MultpleObjectsReturned exception if no duplicates diff --git a/parsers/caves.py b/parsers/caves.py index 34f7143..19b5549 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -181,10 +181,12 @@ def do_ARGE_cave(slug, caveid, areacode, svxid): We already know the survex file. We already know that the cave doesn't exist... though there are bugs.. + Assumes anything in the ARGE list of cave areas is Arge, which is not true for 1626... + caveid may be kataster number or it may be e.g. LA34 """ - default_note = "This is an ARGE cave where we only have the survex file and no other information" + default_note = "This is (probably) an ARGE cave where we only have the survex file and no other information" url = f"{areacode}/{caveid}.html" urltest = Cave.objects.filter(url=url)