Commit 54dd3466f43e86450dd627676c6461872e7d8d02
- Diff rendering mode:
- inline
- side by side
query.py
(7 / 0)
  | |||
78 | 78 | ||
79 | 79 | def calls_unanswered(self, date, dateRange): | |
80 | 80 | return self.t.lt.query.filter(self.t.lt.dcontext=='default', self.t.lt.calldate.between(date,dateRange)).count() | |
81 | |||
82 | def max_duration_UC(self, date, dateRange): | ||
83 | query = self.t.lt.query.with_entities(func.max(self.t.lt.duration).label('duration')).filter(self.t.lt.dcontext=='default', self.t.lt.calldate.between(date,dateRange)) | ||
84 | duration = 0 | ||
85 | for result in query: | ||
86 | duration = result.duration | ||
87 | return duration |
report.py
(4 / 2)
  | |||
79 | 79 | ||
80 | 80 | unanswered_calls = '{0}: {1}'.format("Number of calls unanswered", callDetails.calls_unanswered(startDate, endDate)) | |
81 | 81 | ||
82 | t =Template('$posts\n$recordings\n$impact_stories\n$missed_calls\n$missed_calls_mobilink\n$missed_calls_mobilink_tata\n$answered_calls\n$unanswered_calls\n$filtered_calls\n$average_call_length\n$audio_minutes\n$ch1_minutes\n$ch2_minutes\n$ch3_minutes\n$ch1_load\n$ch2_load\n$ch3_load\n$mobilink_max_load\n$mobilink_max_calls\n$mobilink_min_load\n$mobilink_tata_max_load\n$mobilink_tata_max_calls\n$mobilink_tata_min_load') | ||
83 | report = t.substitute(posts=posts,recordings=recordings,impact_stories=impact_stories,missed_calls=missed_calls,missed_calls_mobilink=missed_calls_mobilink,missed_calls_mobilink_tata=missed_calls_mobilink_tata,answered_calls=answered_calls,unanswered_calls=unanswered_calls,filtered_calls=filtered_calls,average_call_length=average_Call_Length,audio_minutes=audio_Minutes,ch1_minutes=ch1_minutes,ch2_minutes=ch2_minutes,ch3_minutes=ch3_minutes,ch1_load=ch1_load,ch2_load=ch2_load,ch3_load=ch3_load,mobilink_max_load=mobilink_max_load,mobilink_max_calls=mobilink_max_calls,mobilink_min_load=mobilink_min_load,mobilink_tata_max_load=mobilink_tata_max_load,mobilink_tata_max_calls=mobilink_tata_max_calls,mobilink_tata_min_load=mobilink_tata_min_load) | ||
82 | max_duration_UC = '{0}: {1}'.format("Maximum duration of unanswered call(in seconds)", callDetails.max_duration_UC(startDate, endDate)) | ||
83 | |||
84 | t =Template('$posts\n$recordings\n$impact_stories\n$missed_calls\n$missed_calls_mobilink\n$missed_calls_mobilink_tata\n$answered_calls\n$unanswered_calls\n$max_duration_uc\n$filtered_calls\n$average_call_length\n$audio_minutes\n$ch1_minutes\n$ch2_minutes\n$ch3_minutes\n$ch1_load\n$ch2_load\n$ch3_load\n$mobilink_max_load\n$mobilink_max_calls\n$mobilink_min_load\n$mobilink_tata_max_load\n$mobilink_tata_max_calls\n$mobilink_tata_min_load') | ||
85 | report = t.substitute(posts=posts,recordings=recordings,impact_stories=impact_stories,missed_calls=missed_calls,missed_calls_mobilink=missed_calls_mobilink,missed_calls_mobilink_tata=missed_calls_mobilink_tata,answered_calls=answered_calls,unanswered_calls=unanswered_calls,max_duration_uc=max_duration_UC,filtered_calls=filtered_calls,average_call_length=average_Call_Length,audio_minutes=audio_Minutes,ch1_minutes=ch1_minutes,ch2_minutes=ch2_minutes,ch3_minutes=ch3_minutes,ch1_load=ch1_load,ch2_load=ch2_load,ch3_load=ch3_load,mobilink_max_load=mobilink_max_load,mobilink_max_calls=mobilink_max_calls,mobilink_min_load=mobilink_min_load,mobilink_tata_max_load=mobilink_tata_max_load,mobilink_tata_max_calls=mobilink_tata_max_calls,mobilink_tata_min_load=mobilink_tata_min_load) | ||
84 | 86 | return report | |
85 | 87 | ||
86 | 88 | if args.mail is False: |