summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-12-01 13:33:21 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:21 +0100
commit5015e03c0ceabe8ca8a7884e7178bfd246d77788 (patch)
treef828418edadbf957db52121c13575ed7cc3e068c /archaeological_finds/models_finds.py
parent3c25d1f4ab24a1bea9b4be0757f9b8f243564954 (diff)
downloadIshtar-5015e03c0ceabe8ca8a7884e7178bfd246d77788.tar.bz2
Ishtar-5015e03c0ceabe8ca8a7884e7178bfd246d77788.zip
Context records: show find inside related context records
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 9b1f43cb6..6bb8d042e 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -810,17 +810,31 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
'description',
'base_finds__context_record__town__name',
'base_finds__context_record__parcel', ]
+ TABLE_COLS_FOR_CR = [
+ 'base_finds__cache_short_id',
+ 'base_finds__cache_complete_id',
+ 'previous_id', 'label',
+ 'base_finds__context_record__label',
+ 'cached_materials',
+ 'cached_periods',
+ 'find_number',
+ 'cached_object_types',
+ 'container__cached_label',
+ 'container_ref__cached_label',
+ 'description',
+ 'base_finds__context_record__town__name',
+ 'base_finds__context_record__parcel', ]
NEW_QUERY_ENGINE = True
COL_LABELS = {
- 'base_finds__context_record__label': _(u"Context record"),
- 'base_finds__cache_short_id': _(u"Base find - Short ID"),
- 'base_finds__cache_complete_id': _(u"Base find - Complete ID"),
+ 'base_finds__context_record__label': _("Context record"),
+ 'base_finds__cache_short_id': _("Base find - Short ID"),
+ 'base_finds__cache_complete_id': _("Base find - Complete ID"),
'base_finds__context_record__operation__code_patriarche': _(
- u"Operation (code)"
+ "Operation (code)"
),
'base_finds__context_record__town__name': _(u"Town"),
'base_finds__context_record__operation__common_name': _(
- u"Operation (name)"
+ "Operation (name)"
),
'base_finds__context_record__archaeological_site__name':
IshtarSiteProfile.get_default_site_label,
@@ -917,6 +931,8 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
]
BASE_REQUEST = {'downstream_treatment__isnull': True}
EXTRA_REQUEST_KEYS = {
+ 'all_base_finds__context_record':
+ 'base_finds__context_record__context_record_tree_parent__cr_parent_id',
'base_finds__context_record':
'base_finds__context_record__pk',
'base_finds__context_record__archaeological_site':