summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index ec8a5367e..69d9e92bf 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -754,8 +754,8 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
'base_finds__context_record__town__name',
'base_finds__context_record__operation__common_name',
'base_finds__context_record__label',
- 'material_types__label', 'object_types__label',
- 'datings__period__label',
+ 'cached_materials', 'cached_object_types',
+ 'cached_periods',
'container__cached_label',
'container_ref__cached_label']
if settings.COUNTRY == 'fr':
@@ -764,13 +764,17 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
TABLE_COLS_FOR_OPE = [
'base_finds__cache_short_id',
'base_finds__cache_complete_id',
- 'previous_id', 'label', 'material_types__label',
- 'datings__period__label', 'find_number', 'object_types__label',
+ 'previous_id', '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"),
@@ -798,8 +802,11 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
'container__cached_label': _(u"Current container"),
'container_ref__cached_label': _(u"Reference container"),
'datings__period__label': _(u"Periods"),
+ 'cached_periods': _(u"Periods"),
'material_types__label': _(u"Material types"),
+ 'cached_materials': _(u"Material types"),
'object_types__label': _(u"Object types"),
+ 'cached_object_types': _(u"Object types"),
}
EXTRA_FULL_FIELDS = [
@@ -1413,6 +1420,8 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
'remarkabilities', 'communicabilities', 'preservation_to_considers',
'alterations', 'alteration_causes'
]
+ CACHED_LABELS = ['cached_label', 'cached_periods',
+ 'cached_object_types', 'cached_materials']
objects = ExternalIdManager()
# fields
@@ -1563,6 +1572,18 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
help_text=_(u"Related treatments when no new find is created"))
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
+ cached_periods = models.TextField(
+ _("Cached periods label"), blank=True, null=True,
+ help_text=_("Generated automatically - do not edit")
+ )
+ cached_object_types = models.TextField(
+ _("Cached object types label"), blank=True, null=True,
+ help_text=_("Generated automatically - do not edit")
+ )
+ cached_materials = models.TextField(
+ _("Cached material types label"), blank=True, null=True,
+ help_text=_("Generated automatically - do not edit")
+ )
history = HistoricalRecords(bases=[HistoryModel])
BASKET_MODEL = FindBasket