diff options
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:25:17 +0200 |
commit | 653055ac4dc24f50bc82bf9c82c4b17017597c8e (patch) | |
tree | 64e714cbabcdbe9489b997857491f2cf9418a5f4 /archaeological_finds | |
parent | bb7f17f52688f5d4c191c098a19c944a7be17cda (diff) | |
download | Ishtar-653055ac4dc24f50bc82bf9c82c4b17017597c8e.tar.bz2 Ishtar-653055ac4dc24f50bc82bf9c82c4b17017597c8e.zip |
🚑️ templates - finds: do not overload "description" with base find description
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models_finds.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 758fad9bb..83069bafb 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2708,11 +2708,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) |