summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 19f557511..b2c45c86f 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1409,7 +1409,8 @@ class DashboardFormItem(object):
q = cls.objects.filter(**{date_var + '__isnull': False})
if fltr:
q = q.filter(**fltr)
- return q.filter(**{date_var + '__year': year}).distinct('pk')
+ return q.filter(
+ **{date_var + '__year': year}).order_by('pk').distinct('pk')
@classmethod
def get_by_month(cls, year, month, fltr={}, date_source='creation'):
@@ -1419,14 +1420,14 @@ class DashboardFormItem(object):
q = q.filter(**fltr)
q = q.filter(
**{date_var + '__year': year, date_var + '__month': month})
- return q.distinct('pk')
+ return q.order_by('pk').distinct('pk')
@classmethod
def get_total_number(cls, fltr={}):
q = cls.objects
if fltr:
q = q.filter(**fltr)
- return q.distinct('pk').count()
+ return q.order_by('pk').distinct('pk').count()
class Dashboard(object):