summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-10-20 20:40:42 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2014-10-20 20:40:42 +0200
commit57cdf8896f854de7ba573cfe8d5040155df1e656 (patch)
tree28c99961d82172cefbc1c2972789e7f647d05e63 /archaeological_files/models.py
parent2feb794529f3a99ff9ee5402803bafc935f45f72 (diff)
downloadIshtar-57cdf8896f854de7ba573cfe8d5040155df1e656.tar.bz2
Ishtar-57cdf8896f854de7ba573cfe8d5040155df1e656.zip
Dashboard: many improvments on graph (refs #2075)
* by default graph is set by month * data are reapeated in a table * ability to save the graph in a file * detail by department with a line by department + total * add a legend * ability to zoom on the graph
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r--archaeological_files/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 70570e145..a649ceac1 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -230,7 +230,7 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem):
return sorted(owns.all(), key=lambda x:x.cached_label)
@classmethod
- def get_periods(cls, slice='year', fltr={}, date_source='creation'):
+ def get_periods(cls, slice='month', fltr={}, date_source='creation'):
date_var = date_source + '_date'
q = cls.objects.filter(**{date_var+'__isnull':False})
if fltr:
@@ -258,7 +258,8 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem):
q = cls.objects.filter(**{date_var+'__isnull':False})
if fltr:
q = q.filter(**fltr)
- return q.filter(**{date_var+'__year':year, date_var+'__month':month})
+ q = q.filter(**{date_var+'__year':year, date_var+'__month':month})
+ return q
@classmethod
def get_total_number(cls, fltr={}):