diff options
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index e2882df35..3fc1a5afa 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -37,7 +37,7 @@ from ishtar_common.models import Document, GeneralType, \ ImageModel, BaseHistorizedItem, OwnPerms, HistoricalRecords, Person, \ Organization, ValueGetter, post_save_cache, ShortMenuItem, \ DashboardFormItem, ExternalIdManager, document_attached_changed, \ - HistoryModel, SearchAltName + HistoryModel, SearchAltName, SearchVectorConfig from ishtar_common.utils import cached_label_changed, get_current_year, \ update_data, m2m_historization_changed @@ -123,11 +123,23 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, ] BASE_SEARCH_VECTORS = [ - 'treatment_types__label', 'treatment_state__label', 'label', 'goal', - 'external_id', 'comment', 'description', 'other_reference', + SearchVectorConfig("treatment_types__label"), + SearchVectorConfig("treatment_state__label"), + SearchVectorConfig("label"), + SearchVectorConfig("goal", "local"), + SearchVectorConfig("external_id"), + SearchVectorConfig("comment", "local"), + SearchVectorConfig("description", "local"), + SearchVectorConfig("other_reference"), + ] + INT_SEARCH_VECTORS = [ + SearchVectorConfig("year"), + SearchVectorConfig("index"), + ] + M2M_SEARCH_VECTORS = [ + SearchVectorConfig("downstream__cached_label"), + SearchVectorConfig("upstream__cached_label"), ] - INT_SEARCH_VECTORS = ["year", "index"] - M2M_SEARCH_VECTORS = ['downstream__cached_label', 'upstream__cached_label'] PARENT_SEARCH_VECTORS = ['person', 'organization'] objects = ExternalIdManager() @@ -863,9 +875,15 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem, SHOW_URL = 'show-treatmentfile' TABLE_COLS = ['type', 'year', 'index', 'internal_reference', 'name'] BASE_SEARCH_VECTORS = [ - 'type__label', 'internal_reference', 'name', 'comment' + SearchVectorConfig("type__label"), + SearchVectorConfig("internal_reference"), + SearchVectorConfig("name"), + SearchVectorConfig("comment", "local"), + ] + INT_SEARCH_VECTORS = [ + SearchVectorConfig("year"), + SearchVectorConfig("index"), ] - INT_SEARCH_VECTORS = ['year', 'index'] PARENT_SEARCH_VECTORS = ['in_charge', 'applicant', 'applicant_organisation'] EXTRA_REQUEST_KEYS = { |