From 31873237b90c588f49f403721a382df59719ca1b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 2 Jul 2018 19:58:25 +0200 Subject: Full text search: manage facet search (simple, hierarchic, OR) (refs #4180) --- ishtar_common/models.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 86b74693f..d65c08f93 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1094,6 +1094,16 @@ class FullSearch(models.Model): class Meta: abstract = True + @classmethod + def general_types(cls): + for k in get_all_field_names(cls): + field = cls._meta.get_field(k) + if not hasattr(field, 'rel') or not field.rel: + continue + rel_model = field.rel.to + if issubclass(rel_model, (GeneralType, HierarchicalType)): + yield k + def update_search_vector(self, save=True): """ Update the search vector @@ -1275,7 +1285,7 @@ class BaseHistorizedItem(DocumentItem, FullSearch, Imported, JsonData, FixAssociated): """ Historized item with external ID management. - All historized items are searcheable and have a data json field + All historized items are searchable and have a data json field. """ IS_BASKET = False EXTERNAL_ID_KEY = '' -- cgit v1.2.3