From 1d64876a853295d00da80182ceecc31e513a303e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 17 May 2019 13:36:39 +0200 Subject: Statistics - operation and site settings --- archaeological_operations/models.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'archaeological_operations/models.py') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index d18b76f80..6b2cf4ec3 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -117,6 +117,16 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, TABLE_COLS = ['reference', 'name', 'towns_label', 'periods', 'remains'] LONG_SLUG = 'archaeologicalsite' + STATISTIC_MODALITIES_OPTIONS = OrderedDict([ + ("towns__areas__label", _("Area")), + ("towns__areas__parent__label", _("Extended area")), + ("periods__label", _("Periods")), + ("remains__label", _("Remains")), + ("documents__source_type__label", _("Associated document type")), + ]) + STATISTIC_MODALITIES = [ + key for key, lbl in STATISTIC_MODALITIES_OPTIONS.items()] + BASE_SEARCH_VECTORS = [ SearchVectorConfig("comment", 'local'), SearchVectorConfig("discovery_area", 'local'), @@ -529,13 +539,20 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, QRCodeItem, 'operation_type', 'start_date', 'excavation_end_date', 'remains'] # statistics - STATISTIC_MODALITIES = ["year", "operation_type__label", - "towns__cached_label"] STATISTIC_MODALITIES_OPTIONS = OrderedDict([ ('year', _("Year")), ("operation_type__label", _("Operation type")), - ("towns__cached_label", _("Towns")), + ("towns__areas__label", _("Area")), + ("towns__areas__parent__label", _("Extended area")), + ("remains__label", _("Remains")), + ("periods__label", _("Periods")), + ("record_quality_type__label", _("Record quality")), + ("documentation_received", _("Documentation received")), + ("finds_received", _("Finds received")), + ("documents__source_type__label", _("Associated document type")), ]) + STATISTIC_MODALITIES = [ + key for key, lbl in STATISTIC_MODALITIES_OPTIONS.items()] # search parameters BOOL_FIELDS = ['end_date__isnull', 'virtual_operation', -- cgit v1.2.3