2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-21 22:45:19 +00:00

before big revision to wallet model code

This commit is contained in:
2023-10-23 20:24:05 +03:00
parent 2b96086535
commit 1694d01536

View File

@@ -52,8 +52,7 @@ def populatewallet(w):
def caveifywallet(w): def caveifywallet(w):
"""Gets the caves from the list of survex files, """Gets the block names from the list of blocks, set by the survex parser
If called from survex parser, we never need to call it from a view too.
""" """
# print(f' - Caveify {w=}') # print(f' - Caveify {w=}')
blocknames = [] blocknames = []
@@ -133,8 +132,7 @@ def is_cave(wallet, id):
return False return False
def fillblankothers(w): def fillblankothers(w):
"""This is on the way to having a many:many relationship between Caves and Wallets # has this already been done? Do we need to do it on every refresh ?
"""
if not w.walletdate: if not w.walletdate:
set_walletdate(w) set_walletdate(w)
@@ -142,6 +140,8 @@ def fillblankothers(w):
caveifywallet(w) caveifywallet(w)
# Is this not done when we scan for wallets when we create them in the first place ?
# needs to be refactored into models/wallets.py anyway
wcaveid = w.cave() wcaveid = w.cave()
if not wcaveid or wcaveid == "": if not wcaveid or wcaveid == "":
if type(wcaveid) == list: if type(wcaveid) == list:
@@ -338,8 +338,6 @@ def cavewallets(request, caveid):
else: else:
return render(request, "errors/badslug.html", {"badslug": f"{caveid} - from cavewallets()"}) return render(request, "errors/badslug.html", {"badslug": f"{caveid} - from cavewallets()"})
# or now:
wallets = cave.wallets.all() wallets = cave.wallets.all()
manywallets = list(set(wallets)) manywallets = list(set(wallets))
for w in manywallets: for w in manywallets: