diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-06-29 08:55:14 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-06-29 10:31:45 +0300 |
commit | 6d16f8f7caf11bb01d6c6bf3c731db58a8e3276d (patch) | |
tree | 12b80487ea086d9ffa336d7a902195016952c03a /core/models/caves.py | |
parent | 09dbe5b14b2d85417aaebf4e6969135e554594c7 (diff) | |
download | troggle-6d16f8f7caf11bb01d6c6bf3c731db58a8e3276d.tar.gz troggle-6d16f8f7caf11bb01d6c6bf3c731db58a8e3276d.tar.bz2 troggle-6d16f8f7caf11bb01d6c6bf3c731db58a8e3276d.zip |
fixing cave slug <caveslug> issues
Diffstat (limited to 'core/models/caves.py')
-rw-r--r-- | core/models/caves.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index 81c1789..bf495bc 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -114,6 +114,9 @@ class Cave(TroggleModel): slugs = self.caveslug_set.filter() if slugs: return slugs[0].slug + + def newslug(self): + return f"{self.areacode}-{self.number()}" def ours(self): return bool(re.search(r"CUCC", self.explorers)) @@ -522,7 +525,7 @@ def GetCaveLookup(): checkcaveid(cave, slug) # These might alse create more duplicate entries - # Yes, this should be set in, and imported from, settings.py + # Yes, this should be set in, and imported from, an easily editable file # 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 = [ @@ -646,6 +649,8 @@ def GetCaveLookup(): ("2002-x12", "2005-07"), ("2002-x13", "1623-2005-06"), ("2002-x14", "2005-05"), + + # various funnies to cope with cave names used in logbooks ("kh", "1623-161"), ("161-kh", "1623-161"), ("204-steinBH", "1623-204"), @@ -659,10 +664,12 @@ def GetCaveLookup(): ("fgh", "1623-290"), ("fishface", "1623-290"), ("gsh", "1623-291"), + ("1623-2023-lc-01", "1623-318"), ("tempest", "1623-2023-lc-01"), ("1623-2023-kt-02", "2023-kt-02"), - + +# from the git output after Becka's changes, used to construct this list.. # rename caves-1623/{2023-ASH-15/2023-ASH-15.svx => 303/303.svx} (94%) # rename caves-1623/{2023-mg-02/2023-mg-02.svx => 304/304.svx} (90%) # rename caves-1623/{2023-mg-01/2023-mg-01.svx => 305/305.svx} (94%) @@ -694,7 +701,7 @@ def GetCaveLookup(): ("2023-jss-01", "1623-315"), ("2023-kt-01", "1623-316"), - # 1626 aliases2023-mg-01/2023-mg-01.svx => 305 + # 1626 ("langgustl", "1626-354"), ("2018-dm-07", "1626-359"), ("1626-2018-dm-07", "1626-359"), |