summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
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={}):