Esempio n. 1
0
def org_earmarks_section(entity_id, name, cycle, external_ids):
    section = {
        'name': 'Earmarks',
        'template': 'org_earmarks.html',
    }
    
    section['earmarks'] = earmarks_table_data(entity_id, cycle)
    section['earmark_links'] = external_sites.get_earmark_links('organization', name, external_ids, cycle)
    
    return section
Esempio n. 2
0
    def build_section_data(self):
        entity_id, cycle, standardized_name, external_ids = self.entity.entity_id, self.entity.cycle, self.entity.standardized_name, self.entity.external_ids

        local_breakdown = dict([(key, float(value[1])) for key, value in self.data['local_breakdown'].iteritems()])

        self.earmark_links = external_sites.get_earmark_links('politician', standardized_name.name_str(), external_ids, cycle)

        ordered_pie = SortedDict([(key, local_breakdown.get(key, 0)) for key in
            ['Unknown', 'In-State', 'Out-of-State']])
        self.earmarks_local = json.dumps(pie_validate(ordered_pie))
Esempio n. 3
0
    def build_section_data(self):
        entity_id, cycle, standardized_name, external_ids = self.entity.entity_id, self.entity.cycle, self.entity.standardized_name, self.entity.external_ids

        local_breakdown = dict([
            (key, float(value[1]))
            for key, value in self.data['local_breakdown'].iteritems()
        ])

        self.earmark_links = external_sites.get_earmark_links(
            'politician', standardized_name.name_str(), external_ids, cycle)

        ordered_pie = SortedDict([
            (key, local_breakdown.get(key, 0))
            for key in ['Unknown', 'In-State', 'Out-of-State']
        ])
        self.earmarks_local = json.dumps(pie_validate(ordered_pie))
Esempio n. 4
0
def pol_earmarks_section(entity_id, name, cycle, external_ids):
    section = {
        'name': 'Earmarks',
        'template': 'pol_earmarks.html',
    }
    
    section['earmarks'] = earmarks_table_data(entity_id, cycle)

    local_breakdown = api.pol.earmarks_local_breakdown(entity_id, cycle)
    local_breakdown = dict([(key, float(value[1])) for key, value in local_breakdown.iteritems()])

    section['earmark_links'] = external_sites.get_earmark_links('politician', name.name_str(), external_ids, cycle)

    ordered_pie = SortedDict([(key, local_breakdown.get(key, 0)) for key in ['unknown', 'in-state', 'out-of-state']])
    section['earmarks_local'] = json.dumps(pie_validate(ordered_pie))
    
    return section
Esempio n. 5
0
 def build_section_data(self):
     self.earmark_links = external_sites.get_earmark_links('organization', self.entity.standardized_name, self.entity.external_ids, self.entity.cycle)
Esempio n. 6
0
 def build_section_data(self):
     self.earmark_links = external_sites.get_earmark_links(
         'organization', self.entity.standardized_name,
         self.entity.external_ids, self.entity.cycle)