From d319e01c50deeba74674b9e0a6389f3637ce154a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 5 Jan 2021 16:57:05 +0100 Subject: Labels: quick access to operation on the container --- ishtar_common/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 32ae95594..9adba889b 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -161,9 +161,11 @@ class ValueGetter(object): def get_values(self, prefix='', no_values=False, filtr=None, **kwargs): if not prefix: prefix = self._prefix + exclude = kwargs.get("exclude", []) values = {} - if hasattr(self, "qrcode") and (not filtr - or 'qrcode_path' in filtr): + if hasattr(self, "qrcode") and ( + not filtr or prefix + 'qrcode_path' in filtr) and \ + prefix + 'qrcode_path' not in exclude: values[prefix + 'qrcode_path'] = self.qrcode_path for field_name in get_all_field_names(self): try: @@ -172,6 +174,8 @@ class ValueGetter(object): continue if field_name in self.GET_VALUES_EXCLUDE_FIELDS: continue + if prefix + field_name in exclude: + continue if hasattr(value, 'get_values'): new_prefix = prefix + field_name + '_' values.update( -- cgit v1.2.3