Commit f0668c3642acee4c1431671a192e01daa2e9ee32
Fixing typo and removing unused code and modules.
| | | | 1 | import logger | 1 | import logger |
---|
2 | from sqlalchemy.sql import func | 2 | from sqlalchemy.sql import func |
---|
3 | import datetime | 3 | import datetime |
---|
4 | import decimal | | import decimal |
---|
5 | | | |
---|
6 | def toStr(fn): | | def toStr(fn): |
---|
7 | def wrapped(*args, **kwargs): | | def wrapped(*args, **kwargs): |
---|
8 | response = fn(*args, **kwargs) | | response = fn(*args, **kwargs) |
---|
9 | if type(response) is decimal.Decimal: | | if type(response) is decimal.Decimal: |
---|
10 | return str(response) | | return str(response) |
---|
11 | if type(response) is dict: | | if type(response) is dict: |
---|
12 | return repr(response) | | return repr(response) |
---|
13 | else: | | else: |
---|
14 | return str(response) | | return str(response) |
---|
15 | return wrapped | | return wrapped |
---|
16 | | 4 | |
---|
17 | class Query: | 5 | class Query: |
---|
18 | """Objects of query class can be used to run specific queries.""" | 6 | """Objects of query class can be used to run specific queries.""" |
---|
| | | | 71 | | 71 | |
---|
72 | "Number_of_calls_lasting_less_than_30_seconds": callDetails.filter_calls_by_duration(startDate, endDate, 30), | 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, | | "Average_length_of_calls": average_call_length, |
---|
| | 74 | "Average_length_of_calls_in_minutes": average_call_length, | 75 | | 75 | |
---|
76 | "Total_number_of_audio_minutes_played": str(audio_minutes), | 76 | "Total_number_of_audio_minutes_played": str(audio_minutes), |
---|
77 | | 77 | |
---|