From e55d8d335b682f86439457c577c95b1768543f22 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 1 Oct 2018 15:10:07 +0200 Subject: Manage site and warehouse in shortcut menu - Many fixes on pin --- archaeological_context_records/models.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'archaeological_context_records') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index b0e2256a2..ec79748c7 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -257,9 +257,6 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, } RELATION_TYPES_PREFIX = {'ope_relation_types': 'operation__', 'cr_relation_types': ''} - RELATIVE_SESSION_NAMES = [ - ('operation', 'operation__pk'), - ('file', 'operation__associated_file__pk')] # alternative names of fields for searches ALT_NAMES = { 'label': ( @@ -284,7 +281,7 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, ), 'operation__cached_label': ( pgettext_lazy("key for text search", u"operation"), - 'operation__cached_label' + 'operation__cached_label__icontains' ), 'archaeological_site': ( pgettext_lazy("key for text search", u"site"), @@ -324,9 +321,19 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, "excavation_technic__label"] M2M_SEARCH_VECTORS = ["datings__period__label"] UP_MODEL_QUERY = { - "OPE": (pgettext_lazy("key for text search", u"operation"), - 'cached_label'), + "operation": ( + pgettext_lazy("key for text search", u"operation"), + 'cached_label'), + "site": ( + pgettext_lazy("key for text search", u"site"), + 'cached_label'), } + RELATIVE_SESSION_NAMES = [ + ('operation', 'operation__pk'), + ('site', 'archaeological_site__pk'), + ('file', 'operation__associated_file__pk'), + ] + history = HistoricalRecords() # fields -- cgit v1.2.3