def get_chartdata(queryset, startdate, enddate): result = dict() datelist = DateTimeHelper.generate_datelist(startdate, enddate) for date in datelist: result[str(date)] = 0 for item in queryset: result[str(item[0])] = item[1] return result
def get_perday_closedbugcounts_data(submitionid): bugcounts = list() result = list() query_info = BugReportService.get_query_info(submitionid) openedresult = DAL_BugReport.get_closed_bugcounts_perday( str(query_info[0]), str(query_info[1]), query_info[2]) result_dict = BugReportService.get_chartdata(openedresult, str(query_info[0]), str(query_info[1])) datelist = DateTimeHelper.generate_datelist(str(query_info[0]), str(query_info[1])) for date in datelist: bugcounts.append(result_dict[str(date)]) result.append(datelist) result.append(bugcounts) return result
def get_all_openedbugcounts_data(submitionid): bugcounts = list() result = list() query_info = BugReportService.get_query_info(submitionid) openedresult = DAL_BugReport.get_opened_bugcounts_perday( str(query_info[0]), str(query_info[1]), query_info[2]) result_dict = BugReportService.get_chartdata(openedresult, str(query_info[0]), str(query_info[1])) datelist = DateTimeHelper.generate_datelist(str(query_info[0]), str(query_info[1])) i = 0 for date in datelist: if len(bugcounts): all_opendbugcounts = bugcounts[i] + int(result_dict[str(date)]) i = i + 1 else: all_opendbugcounts = int(result_dict[str(date)]) i = 0 bugcounts.append(all_opendbugcounts) all_opendbugcounts = 0 result.append(datelist) result.append(bugcounts) return result