diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-10 16:39:24 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-10 17:47:43 +0200 |
commit | 2bd5215f38b29e6e97b0d67642ba5e131770efed (patch) | |
tree | 457292661aa7043aea3bc05b9a0a39190bf8b8b5 | |
parent | 4977ca6f61f6353543fd177a440300dddc5319e9 (diff) | |
download | Ishtar-develop.tar.bz2 Ishtar-develop.zip |
⚡️ template containers: improve performancedevelop
-rw-r--r-- | archaeological_warehouse/models.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 9a253e735..8c9a94f06 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1927,8 +1927,12 @@ class Container( if not filtr or cr_in_filter: kwargs["exclude"] = base_exclude[:] + [prefix + "operation"] kwargs["force_no_base_finds"] = True + cr_prefix = "context_record_" + new_filtr = [ + k[len(cr_prefix):] for k in filtr if k.startswith(cr_prefix) + ] for k, v in cr.get_values( - prefix=prefix, no_values=True, filtr=None, **kwargs + prefix=prefix, no_values=True, filtr=new_filtr, **kwargs ).items(): values[prefix + "context_record_" + k] = v if not filtr or operation_in_filter: @@ -1937,8 +1941,12 @@ class Container( f"{prefix}document_containers", f"{prefix}all_containers" ] + op_prefix = "operation_" + new_filtr = [ + k[len(op_prefix):] for k in filtr if k.startswith(op_prefix) + ] for k, v in cr.operation.get_values( - prefix=prefix, no_values=True, filtr=None, **kwargs + prefix=prefix, no_values=True, filtr=new_filtr, **kwargs ).items(): values[prefix + "operation_" + k] = v return values |