summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-05-20 17:16:50 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:28 +0200
commit70f66c8340d19712cf82a86e965ee3f675218b3f (patch)
tree7d744536cddab49657d621bb3f3f11f5bfb3edb7
parentade613552c8b3ad46615659de5b44b633c7c8baa (diff)
downloadIshtar-70f66c8340d19712cf82a86e965ee3f675218b3f.tar.bz2
Ishtar-70f66c8340d19712cf82a86e965ee3f675218b3f.zip
Statistics: finds settings
-rw-r--r--archaeological_finds/models_finds.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 7bd33018f..57ae1549c 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -17,6 +17,7 @@
# See the file COPYING for details.
+from collections import OrderedDict
import datetime
from django.conf import settings
@@ -812,6 +813,40 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
]
ATTRS_EQUIV = {'get_first_base_find': 'base_finds'}
+ # statistics
+ STATISTIC_MODALITIES_OPTIONS = OrderedDict([
+ ('base_finds__context_record__operation__year', _("Year")),
+ ("base_finds__context_record__operation__operation_type__label",
+ _("Operation type")),
+ ("base_finds__context_record__operation__towns__areas__label",
+ _("Area")),
+ ("base_finds__context_record__operation__towns__areas__parent__label",
+ _("Extended area")),
+ ("datings__period__label", _("Period")),
+ ("material_types__label", _("Material type")),
+ ("object_types__label", _("Object type")),
+ ("preservation_to_considers__label", _("Preservation to consider")),
+ ("conservatory_state__label", _("Conservatory state")),
+ ("integrities__label", _("Integrity / interest")),
+ ("remarkabilities__label", _("Remarkability")),
+ ("communicabilities__label", _("Communicability")),
+ ("checked_type__label", _("Check")),
+ ("alterations__label", _("Alteration")),
+ ("alteration_causes__label", _("Alteration cause")),
+ ("treatment_emergency__label", _("Treatment emergency")),
+ ("documents__source_type__label", _("Associated document type")),
+ ])
+ STATISTIC_MODALITIES = [
+ key for key, lbl in STATISTIC_MODALITIES_OPTIONS.items()]
+ STATISTIC_SUM_VARIABLE = OrderedDict(
+ (
+ ("pk", _("Number")),
+ ("weight", _("Weight")),
+ ("estimated_value", _("Estimated value")),
+ ("insurance_value", _("Insurance value")),
+ )
+ )
+
# search parameters
REVERSED_BOOL_FIELDS = ['documents__image__isnull']
BOOL_FIELDS = ['is_complete']
@@ -1103,7 +1138,7 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem,
pgettext_lazy("key for text search", "object-type-quality"),
'object_type_quality__label__iexact'),
'find_number':
- SearchAltName(
+ SearchAltName(
pgettext_lazy("key for text search", "find-number"),
'find_number'),
'min_number_of_individuals':