summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)