summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-05-17 17:49:02 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:28 +0200
commitf10df0f9746189dfd372c45fc5fb7df34e799284 (patch)
treeb34dffb4ef5cef2f44eaeedce44c852110063fdf /archaeological_files/models.py
parent58372794b50885e38b6f6cebe042801453781676 (diff)
downloadIshtar-f10df0f9746189dfd372c45fc5fb7df34e799284.tar.bz2
Ishtar-f10df0f9746189dfd372c45fc5fb7df34e799284.zip
Statistics: file settings
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r--archaeological_files/models.py20
1 files changed, 20 insertions, 0 deletions
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']