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
commitf87fd09770ab0738855a5efbaff905a7c9f346ac (patch)
tree28c99961d82172cefbc1c2972789e7f647d05e63 /archaeological_files/models.py
parent5a2f2af0d2eada644241c234494b0d20abf13f85 (diff)
downloadIshtar-f87fd09770ab0738855a5efbaff905a7c9f346ac.tar.bz2
Ishtar-f87fd09770ab0738855a5efbaff905a7c9f346ac.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={}):