def rapports_index(): counties = db.get_counties() births = {} deaths = {} total_b = 0 total_d = 0 for county in counties: name = county['name'] births[name] = len(db.get_births_in_county(name)) deaths[name] = len(db.get_deaths_in_county(name)) total_b += births[name] total_d += deaths[name] return render_template('rapports/index.html', counties=counties, births=births, deaths=deaths, total_b=total_b, total_d=total_d)