diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-10 16:09:56 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-10 16:09:56 +0100 |
commit | 2bc60033c79780e11a05011b5c803da83f03a8fe (patch) | |
tree | 9660d194a2f3fb5a31b5051c46312a418053c471 /archaeological_finds/models_treatments.py | |
parent | 68167561b14b4f92375d035476f4a79093a0b1ea (diff) | |
download | Ishtar-2bc60033c79780e11a05011b5c803da83f03a8fe.tar.bz2 Ishtar-2bc60033c79780e11a05011b5c803da83f03a8fe.zip |
Full-search index: year index for treatments - town for warehouse
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 1f2ad1c0f..a8a06ae27 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -143,6 +143,9 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, SearchVectorConfig("description", "local"), SearchVectorConfig("other_reference"), ] + PROPERTY_SEARCH_VECTORS = [ + SearchVectorConfig("year_index"), + ] INT_SEARCH_VECTORS = [ SearchVectorConfig("year"), SearchVectorConfig("index"), @@ -248,6 +251,10 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, def natural_key(self): return (self.external_id, ) + @property + def year_index(self): + return "{}-{}".format(self.year, self.index) + @classmethod def get_query_owns(cls, ishtaruser): return (Q(history_creator=ishtaruser.user_ptr) | |