diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-02 19:58:25 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:03 +0200 |
commit | 31873237b90c588f49f403721a382df59719ca1b (patch) | |
tree | 38143096a878386d25f9d950a8c4248a30187344 /ishtar_common/models.py | |
parent | 8533647dd9c2eb008ccfca14813e055e1f5708ef (diff) | |
download | Ishtar-31873237b90c588f49f403721a382df59719ca1b.tar.bz2 Ishtar-31873237b90c588f49f403721a382df59719ca1b.zip |
Full text search: manage facet search (simple, hierarchic, OR) (refs #4180)
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 12 |
1 files changed, 11 insertions, 1 deletions
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 = '' |