diff options
Diffstat (limited to 'archaeological_finds')
-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) | |