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 | 0b47ccd2149ae923536d4d8a012af72c2b17c520 (patch) | |
tree | 9660d194a2f3fb5a31b5051c46312a418053c471 | |
parent | 9a7d51fe1c67bad74b6463c6f935ef1ee8e67ffa (diff) | |
download | Ishtar-0b47ccd2149ae923536d4d8a012af72c2b17c520.tar.bz2 Ishtar-0b47ccd2149ae923536d4d8a012af72c2b17c520.zip |
Full-search index: year index for treatments - town for warehouse
-rw-r--r-- | archaeological_finds/models_treatments.py | 7 | ||||
-rw-r--r-- | archaeological_warehouse/models.py | 1 |
2 files changed, 8 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) | diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 75a3deda0..325adce9e 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -65,6 +65,7 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem, SearchVectorConfig("warehouse_type__label"), SearchVectorConfig("external_id"), SearchVectorConfig("town"), + SearchVectorConfig("precise_town__name"), SearchVectorConfig("comment", "local"), ] |