summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py19
1 files changed, 13 insertions, 6 deletions
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