From 304dfe331142cea1c426942b8db7f6fc3541b7a5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 17 May 2019 17:49:02 +0200 Subject: Statistics: file settings --- archaeological_files/models.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'archaeological_files') diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 30393c80c..c4bdb68f5 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -18,6 +18,7 @@ # See the file COPYING for details. import datetime +from collections import OrderedDict from django.conf import settings from django.contrib.gis.db import models @@ -88,6 +89,25 @@ class File(ClosedItem, DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter, SHOW_URL = 'show-file' TABLE_COLS = ['numeric_reference', 'year', 'internal_reference', 'file_type', 'saisine_type', 'towns_label', ] + # statistics + STATISTIC_MODALITIES_OPTIONS = OrderedDict([ + ('year', _("Year")), + ("file_type__label", _("File type")), + ("towns__areas__label", _("Area")), + ("towns__areas__parent__label", _("Extended area")), + ("saisine_type__label", "Type de saisine"), + ("permit_type__label", _("Permit type")), + ("requested_operation_type__label", _("File type")), + ]) + STATISTIC_MODALITIES = [ + key for key, lbl in STATISTIC_MODALITIES_OPTIONS.items()] + STATISTIC_SUM_VARIABLE = OrderedDict( + ( + ("pk", _("Number")), + ("total_surface", _(u"Total surface (m2)")), + ("total_developed_surface", _(u"Total developed surface (m2)")), + ) + ) # search parameters BOOL_FIELDS = ['end_date__isnull'] -- cgit v1.2.3