diff options
Diffstat (limited to 'core/models/caves.py')
-rw-r--r-- | core/models/caves.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index c9405ee..4cf0512 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -12,7 +12,7 @@ import settings from troggle.core.models.logbooks import QM from troggle.core.models.survex import SurvexStation, utmToLatLng from troggle.core.models.troggle import DataIssue, TroggleModel -from troggle.core.utils import TROG, writetrogglefile +from troggle.core.utils import TROG, writetrogglefile, parse_aliases # Use the TROG global object to cache the cave lookup list. No good for multi-user.., or even multi-page. Pointless in fact. Gcavelookup = TROG["caves"]["gcavelookup"] @@ -532,10 +532,19 @@ def GetCaveLookup(): print(cave, cave.slug()) # These might alse create more duplicate entries - # Yes, this should be set in, and imported from, an easily editable file + aliases = [] + # read the two files in /cave_data/ + for ca in ["cavealiasesold.txt", "cavealiases.txt"]: + pairs, report = parse_aliases(ca) + aliases += pairs + + # print(f"Loaded aliases, {len(aliases)} found\n{report}\n {aliases}") + # On reset, these aliases only work if the cave already properly exists with an entry in :expoweb:/cave_data/ # but as the aliases are recomputed repeatedly, eventually they work on PENDING caves too - aliases = [ + + # oldaliases are NOT USED. We are reading from the files instead now. Pending deletion.. + oldaliases = [ ("1987-02", "1623-267"), ("1990-01", "1623-171"), ("1990-02", "1623-172"), |