Exemplo n.º 1
0
 def get_summary(self, org):
     return {
         'total_incoming': DailyCount.get_by_org([org], DailyCount.TYPE_INCOMING).total(),
         'total_replies': DailyCount.get_by_org([org], DailyCount.TYPE_REPLIES).total(),
         'cases_open': Case.objects.filter(org=org, closed_on=None).count(),
         'cases_closed': Case.objects.filter(org=org).exclude(closed_on=None).count()
     }
Exemplo n.º 2
0
 def get_summary(self, org):
     return {
         "total_incoming":
         DailyCount.get_by_org([org], DailyCount.TYPE_INCOMING).total(),
         "total_replies":
         DailyCount.get_by_org([org], DailyCount.TYPE_REPLIES).total(),
         "cases_open":
         Case.objects.filter(org=org, closed_on=None).count(),
         "cases_closed":
         Case.objects.filter(org=org).exclude(closed_on=None).count(),
     }
Exemplo n.º 3
0
 def evaluate(self, org: Org) -> int:
     return DailyCount.get_by_org([org],
                                  DailyCount.TYPE_REPLIES,
                                  since=days_ago(90)).total()
Exemplo n.º 4
0
 def evaluate(self, org: Org) -> int:
     return DailyCount.get_by_org([org], DailyCount.TYPE_REPLIES).total()