summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-06-13 12:04:48 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-06-13 12:04:48 +0200
commitae586d0afae14a3eace51f4d4a70e2234a960dc8 (patch)
treeee01b02420ac03c82b3e62885e630244d4b1b264
parentcee233fb87e42afc8b5ffc241d1fcd4f12139bc4 (diff)
downloadIshtar-ae586d0afae14a3eace51f4d4a70e2234a960dc8.tar.bz2
Ishtar-ae586d0afae14a3eace51f4d4a70e2234a960dc8.zip
🚑️ templates - finds: do not overload "description" with base find description
-rw-r--r--archaeological_finds/models_finds.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 49b750459..ffe397948 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -2609,11 +2609,17 @@ class Find(
if not bf:
return values
alt_filtr = [k[len("base_find_"):] for k in filtr if k.startswith("base_find_")]
- alt_filtr += filtr # use simple and "base_find" prefix notation
+ alt_filtr += filtr
v = bf.get_values(prefix=prefix, no_values=True, filtr=alt_filtr, **kwargs)
- v.update(dict((('base_find_' + k, v) for k, v in v.items()))) # use simple and "base_find" prefix notation
- v.update(values)
- values = v
+ new_values = {}
+ # use simple notation for base finds to simplify templates
+ for k in v:
+ if not hasattr(self, k): # do not overload existings fields
+ new_values[k] = v[k]
+ # "base_find" prefix notation
+ new_values.update(dict((('base_find_' + k, v) for k, v in v.items())))
+ new_values.update(values)
+ values = new_values
kwargs["no_find"] = True
values[prefix + "base_finds"] = [
base_find.get_values(no_values=True, filtr=filtr, **kwargs)