summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py12
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 = ''