def get_copy_report_hash_for_render(self): new_reports = [] sql = "SELECT id, title FROM report ORDER BY ID" self.reportmap = dbhelper.get_all(self.env.get_db_cnx(), sql)[1] for report_group in all_reports: new_group = {"title": report_group["title"]} reports_list = report_group["reports"] new_reports_list = [] for report in reports_list: title = report["title"] #find the report id for the name reportid = [ self.reportmap[i][0] for i in range(0, len(self.reportmap)) if self.reportmap[i][1] == title ][0] new_report = { "title": title, "reportnumber": reportid, "href": "%s/%s" % (self.env.href.report(), reportid) } new_reports_list.extend([new_report]) new_group["reports"] = new_reports_list new_reports.extend([new_group]) return new_reports
def __init__(self, comp): self.component = comp rows = dbhelper.get_all(comp, "SELECT id FROM custom_report")[1] if rows: self.billing_reports = set([x[0] for x in rows]) else: self.billing_reports = set() self.component.log.debug('self.billing_reports= %r' % self.billing_reports)
def get_copy_report_hash_for_render(self): new_reports = [] sql = "SELECT id, title FROM report ORDER BY ID" self.reportmap = dbhelper.get_all(self.env.get_db_cnx(), sql)[1] for report_group in all_reports: new_group = { "title" : report_group["title"] } reports_list = report_group["reports"] new_reports_list = [] for report in reports_list: title = report["title"] #find the report id for the name reportid = [self.reportmap[i][0] for i in range(0, len(self.reportmap)) if self.reportmap[i][1] == title][0] new_report = {"title" : title, "reportnumber" : reportid, "href" : "%s/%s" % (self.env.href.report(), reportid)} new_reports_list.extend([ new_report ]) new_group["reports"] = new_reports_list new_reports.extend([new_group]) return new_reports
def __init__(self): sql = "SELECT id, title FROM report ORDER BY ID" self.reportmap = dbhelper.get_all(self.env.get_db_cnx(), sql)[1]
def get_billing_reports(comp): billing_reports = set() rows = dbhelper.get_all(comp.env, "SELECT id FROM custom_report")[1] if rows: billing_reports = set([x[0] for x in rows]) return billing_reports
def get_billing_reports(comp): billing_reports = set() rows = dbhelper.get_all(comp, "SELECT id FROM custom_report")[1] if rows: billing_reports = set([x[0] for x in rows]) return billing_reports
def home(): crimes = dbhelper.get_all() crimes = json.dumps(crimes) return render_template("home.html", crimes=crimes)