From eb039681c8ac7fbab9905b1a3dedc355523ee8ba Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 24 Sep 2020 12:12:55 +0200 Subject: Stats for containers --- archaeological_warehouse/models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'archaeological_warehouse/models.py') diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index d24985645..d30a90f56 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -17,6 +17,7 @@ # See the file COPYING for details. +from collections import OrderedDict import datetime import uuid @@ -538,6 +539,15 @@ class Container(DocumentItem, Merge, LightHistorizedItem, QRCodeItem, GeoItem, ] PARENT_SEARCH_VECTORS = ["parent"] + STATISTIC_MODALITIES_OPTIONS = OrderedDict([ + ("location__name", _("Location (warehouse)")), + ("responsible__name", _("Responsible (warehouse)")), + ('finds__base_finds__context_record__operation__cached_label', + _("Operation")), + ]) + STATISTIC_MODALITIES = [ + key for key, lbl in STATISTIC_MODALITIES_OPTIONS.items()] + # search parameters EXTRA_REQUEST_KEYS = { 'location': 'location__pk', -- cgit v1.2.3