From d43af7a4629f8c49107888224ccf2d6867d3e04b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 19 Feb 2018 12:12:05 +0100 Subject: Document generation: filter irrelevant fields (refs #3932) --- ishtar_common/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 88ad3009a..201cf7c21 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -133,13 +133,16 @@ class ValueGetter(object): _prefix = "" GET_VALUES_EXTRA = [] COL_LABELS = {} + GET_VALUE_EXCLUDE_FIELDS = ['search_vector', 'id'] def get_values(self, prefix=''): if not prefix: prefix = self._prefix values = {} for field_name in get_all_field_names(self): - if not hasattr(self, field_name): + if not hasattr(self, field_name) or \ + field_name in self.GET_VALUE_EXCLUDE_FIELDS or \ + field_name.endswith('_id'): continue value = getattr(self, field_name) if hasattr(value, 'get_values'): -- cgit v1.2.3