Commit f0668c3642acee4c1431671a192e01daa2e9ee32
- Diff rendering mode:
- inline
- side by side
query.py
(0 / 12)
  | |||
1 | 1 | import logger | |
2 | 2 | from sqlalchemy.sql import func | |
3 | 3 | import datetime | |
4 | import decimal | ||
5 | |||
6 | def toStr(fn): | ||
7 | def wrapped(*args, **kwargs): | ||
8 | response = fn(*args, **kwargs) | ||
9 | if type(response) is decimal.Decimal: | ||
10 | return str(response) | ||
11 | if type(response) is dict: | ||
12 | return repr(response) | ||
13 | else: | ||
14 | return str(response) | ||
15 | return wrapped | ||
16 | 4 | ||
17 | 5 | class Query: | |
18 | 6 | """Objects of query class can be used to run specific queries.""" |
report.py
(1 / 1)
  | |||
71 | 71 | ||
72 | 72 | "Number_of_calls_lasting_less_than_30_seconds": callDetails.filter_calls_by_duration(startDate, endDate, 30), | |
73 | 73 | ||
74 | "Average_length_of_calls": average_call_length, | ||
74 | "Average_length_of_calls_in_minutes": average_call_length, | ||
75 | 75 | ||
76 | 76 | "Total_number_of_audio_minutes_played": str(audio_minutes), | |
77 | 77 |