diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-24 19:14:37 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:25 +0100 |
commit | 16a47f887447ecccd56fc848aee95fa56af92548 (patch) | |
tree | f96e518b2766d2a300829d0e5f9fac491d6d065d /archaeological_warehouse | |
parent | 0eab67538b8f2af9283bf1e77438763914e355b7 (diff) | |
download | Ishtar-16a47f887447ecccd56fc848aee95fa56af92548.tar.bz2 Ishtar-16a47f887447ecccd56fc848aee95fa56af92548.zip |
get_values: get containers from operation - material_types_code from finds
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r-- | archaeological_warehouse/models.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index d049b8093..16bbaab40 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1438,7 +1438,7 @@ class Container(DocumentItem, Merge, LightHistorizedItem, def get_material_types_code(self) -> str: """ - Return dash separated material type code inside a container + Return pipe separated material type code inside a container """ materials = set() for material in self.finds.exclude( @@ -1463,7 +1463,8 @@ class Container(DocumentItem, Merge, LightHistorizedItem, prefix=prefix, no_values=no_values, filtr=filtr, **kwargs) from_find = prefix.startswith("container_") or \ prefix.startswith("container_ref_") - if (not filtr or prefix + 'finds' in filtr) and not from_find: + if (not filtr or prefix + 'finds' in filtr) and not from_find and \ + "finds" not in kwargs.get("exclude", []): kwargs["exclude"] = [prefix + "container", prefix + "container_ref"] # prevent recursive call values[prefix + 'finds'] = [ |