summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-05 11:33:54 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-05 11:33:54 +0200
commit2e512bc9dffca5624342aa75ca01b3ff7f390141 (patch)
tree21976a27b67c98aa1a79a63f190d06dd489b89ec /ishtar_common
parent3a5dbf688d058bd39aaae308cd7224ddd42c7890 (diff)
downloadIshtar-2e512bc9dffca5624342aa75ca01b3ff7f390141.tar.bz2
Ishtar-2e512bc9dffca5624342aa75ca01b3ff7f390141.zip
Warehouse sheet: provide statistics (refs #3398)
- Number of finds (total and by places) - Number of container (total and by places)
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py13
-rw-r--r--ishtar_common/static/media/style.css6
2 files changed, 19 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index bf5c6056a..1632cbfb2 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1306,6 +1306,19 @@ class UserDashboard:
class DashboardFormItem(object):
+ """
+ Provide methods to manage statistics
+ """
+
+ def _get_or_set_stats(self, funcname, update,
+ timeout=settings.CACHE_TIMEOUT):
+ 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, timeout)
+ return val
+
@classmethod
def get_periods(cls, slice='month', fltr={}, date_source='creation'):
date_var = date_source + '_date'
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css
index fc840526e..011db3652 100644
--- a/ishtar_common/static/media/style.css
+++ b/ishtar_common/static/media/style.css
@@ -324,6 +324,12 @@ ul.list{
line-height:16px;
}
+.centered{
+ text-align: center;
+ width: 100%;
+ display: inline-block;
+}
+
div.nav-button{
cursor:pointer;
width:15px;