From 2e2d42111a9fae88c174557db206fa08d3d24730 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 9 Mar 2022 12:13:49 +0100 Subject: Templates: optimize template render for containers --- ishtar_common/models.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index f483020e0..7d634a680 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -297,6 +297,10 @@ class ValueGetter(object): values[prefix + field_name] = value values.update(self._get_values_documents(prefix=prefix, filtr=filtr)) for extra_field in self.GET_VALUES_EXTRA: + if filtr and not any( + extra_field for f in filtr if f.startswith(prefix + extra_field) + ): + continue values[prefix + extra_field] = getattr(self, extra_field) or "" for key, val in values.items(): if val is None: -- cgit v1.2.3