From 8ff14b5402eb5af8685d2c3783b3bd5bdb2ec9a2 Mon Sep 17 00:00:00 2001
From: Étienne Loks
Date: Wed, 29 Mar 2017 19:14:27 +0200
Subject: Operations: add collaborators field (refs #3368)
---
archaeological_operations/templates/ishtar/sheet_operation.html | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
(limited to 'archaeological_operations/templates')
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 48116433c..71f41d8c4 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -29,10 +29,11 @@
{% include "ishtar/blocks/sheet_creation_section.html" %}
{% trans "Begining date" as begining_date_label %}
{% field_li begining_date_label item.start_date %}
-{% field_li "Excavation end date" item.excavation_end_date|default:"-" %}
-{% field_li_detail "Head scientist" item.scientist %}
-{% field_li_detail "In charge" item.in_charge %}
-{% field_li_detail "Operator" item.operator %}
+ {% field_li "Excavation end date" item.excavation_end_date|default:"-" %}
+ {% field_li_detail "Head scientist" item.scientist %}
+ {% field_li_detail "In charge" item.in_charge %}
+ {% field_li_multiple "Collaborators" item.collaborators %}
+ {% field_li_detail "Operator" item.operator %}
{% if item.is_active %}{%trans "Active file"%}
{% else %}{%trans "Closed operation"%} {% endif %}
{% if item.closing.date %} {{ item.closing.date }} {%trans "by" %} {{ item.closing.user }}{% endif %}
--
cgit v1.2.3
From 2e512bc9dffca5624342aa75ca01b3ff7f390141 Mon Sep 17 00:00:00 2001
From: Étienne Loks
Date: Wed, 5 Apr 2017 11:33:54 +0200
Subject: Warehouse sheet: provide statistics (refs #3398)
- Number of finds (total and by places)
- Number of container (total and by places)
---
archaeological_finds/models_finds.py | 8 +-
archaeological_operations/models.py | 8 --
.../templates/ishtar/sheet_operation.html | 1 +
archaeological_warehouse/models.py | 103 ++++++++++++++++++++-
.../templates/ishtar/sheet_warehouse.html | 44 +++++++++
example_project/settings.py | 2 +-
ishtar_common/models.py | 13 +++
ishtar_common/static/media/style.css | 6 ++
8 files changed, 168 insertions(+), 17 deletions(-)
(limited to 'archaeological_operations/templates')
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 3785267b2..52601c896 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -37,7 +37,6 @@ from archaeological_operations.models import AdministrativeAct
from archaeological_context_records.models import ContextRecord, Dating
from ishtar_common.models import PRIVATE_FIELDS, SpatialReferenceSystem
-from archaeological_warehouse.models import Container, Collection
class MaterialType(GeneralType):
@@ -637,7 +636,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
datings = models.ManyToManyField(Dating, verbose_name=_(u"Dating"),
related_name='find')
container = models.ForeignKey(
- Container, verbose_name=_(u"Container"), blank=True, null=True,
+ "archaeological_warehouse.Container", verbose_name=_(u"Container"),
+ blank=True, null=True,
related_name='finds', on_delete=models.SET_NULL)
is_complete = models.NullBooleanField(_(u"Is complete?"), blank=True,
null=True)
@@ -671,8 +671,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
estimated_value = models.FloatField(_(u"Estimated value"), blank=True,
null=True)
collection = models.ForeignKey(
- Collection, verbose_name=_(u"Collection"), blank=True, null=True,
- related_name='finds', on_delete=models.SET_NULL)
+ "archaeological_warehouse.Collection", verbose_name=_(u"Collection"),
+ blank=True, null=True, related_name='finds', on_delete=models.SET_NULL)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True)
history = HistoricalRecords()
BASKET_MODEL = FindBasket
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index bef149b2c..3826678c3 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -593,14 +593,6 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
nb = self.parcels.count()
return nb
- def _get_or_set_stats(self, funcname, update):
- key, val = get_cache(self.__class__, [funcname, self.pk])
- if not update and val is not None:
- return val
- val = getattr(self, funcname)()
- cache.set(key, val, settings.CACHE_TIMEOUT)
- return val
-
@property
def nb_acts(self, update=False):
_(u"Number of administrative acts")
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 71f41d8c4..5051c4604 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -142,6 +142,7 @@
{% endif %}
{% trans "Statistics" %}
+{% trans "Theses number are updated hourly" %}
{% trans "Administrative acts" %}