diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-01-05 16:57:05 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:23 +0100 | 
| commit | 605b06762736e2dff6f6aa8e812862115bcfb0cf (patch) | |
| tree | 8b84cd2075d6d78144126b73febe7cb0e0f9792c /ishtar_common/models.py | |
| parent | 8aa747850493a48e13e7a7ad6255f833aeedcd63 (diff) | |
| download | Ishtar-605b06762736e2dff6f6aa8e812862115bcfb0cf.tar.bz2 Ishtar-605b06762736e2dff6f6aa8e812862115bcfb0cf.zip  | |
Labels: quick access to operation on the container
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 8 | 
1 files changed, 6 insertions, 2 deletions
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(  | 
