Ejemplo n.º 1
0
def table_sector_breakdown(opensecrets_id):

    sector_total_dict = model.get_all_amounts(opensecrets_id)
    keys2 = sector_total_dict.keys()

    for key in keys2:
        sector_total_dict[key] = locale.currency(sector_total_dict[key], \
            grouping=True)

    sector_keys = sector_total_dict.keys()
    sectors = model.get_sectors(opensecrets_id)
    legislator_data = model.get_legislator_name(opensecrets_id)

    return render_template('legislator.html', sectors=sectors, \
        opensecrets_id=opensecrets_id, sector_total_dict=sector_total_dict,\
        sector_keys=sector_keys, legislator=legislator_data[0], \
        district=legislator_data[1])
Ejemplo n.º 2
0
def make_bubbles(opensecrets_id):
    legislator_data = model.get_legislator_name(opensecrets_id)
    return render_template('bubble.html', opensecrets_id=opensecrets_id,\
        legislator=legislator_data[0], district=legislator_data[1])