Example #1
0
    def build_section_data(self):
        entity_id, name, cycle, type, external_ids, is_lobbying_firm = \
            self.entity.entity_id, self.entity.standardized_name, self.entity.cycle, self.entity.type, self.entity.external_ids, self.entity_is_lobbying_firm

        self.lobbying_data = True
        self.is_lobbying_firm = is_lobbying_firm

        if is_lobbying_firm:
            self.lobbying_issues    =  [item['issue'] for item in self.data['lobbying_issues']]
            self.lobbying_bills     = [{
                'bill': bill['bill_name'],
                'title': bill['title'],
                'link': make_bill_link(bill),
                'congress': bill['congress_no'],
            } for bill in self.data['lobbying_bills']]
            self.lobbying_links = external_sites.get_lobbying_links('firm', name, external_ids, cycle)
        else:
            self.lobbying_issues    =  [item['issue'] for item in self.data['lobbying_issues']]
            self.lobbying_bills     = [ {
                'bill': bill['bill_name'],
                'title': bill['title'],
                'link': make_bill_link(bill),
                'congress': bill['congress_no'],
            } for bill in self.data['lobbying_bills']]
            self.lobbying_links = external_sites.get_lobbying_links('industry' if type == 'industry' else 'client', name, external_ids, cycle)
Example #2
0
    def build_section_data(self):
        entity_id, name, cycle, type, external_ids, is_lobbying_firm = \
            self.entity.entity_id, self.entity.standardized_name, self.entity.cycle, self.entity.type, self.entity.external_ids, self.entity_is_lobbying_firm

        self.lobbying_data = True
        self.is_lobbying_firm = is_lobbying_firm

        if is_lobbying_firm:
            self.lobbying_issues = [
                item['issue'] for item in self.data['lobbying_issues']
            ]
            self.lobbying_bills = [{
                'bill': bill['bill_name'],
                'title': bill['title'],
                'link': make_bill_link(bill),
                'congress': bill['congress_no'],
            } for bill in self.data['lobbying_bills']]
            self.lobbying_links = external_sites.get_lobbying_links(
                'firm', name, external_ids, cycle)
        else:
            self.lobbying_issues = [
                item['issue'] for item in self.data['lobbying_issues']
            ]
            self.lobbying_bills = [{
                'bill': bill['bill_name'],
                'title': bill['title'],
                'link': make_bill_link(bill),
                'congress': bill['congress_no'],
            } for bill in self.data['lobbying_bills']]
            self.lobbying_links = external_sites.get_lobbying_links(
                'industry' if type == 'industry' else 'client', name,
                external_ids, cycle)
Example #3
0
def org_lobbying_section(entity_id, name, cycle, type, external_ids, is_lobbying_firm):
    section = {
        'name': 'Lobbying',
        'template': '%s_lobbying.html' % ('org' if type == 'organization' else 'industry'),
    }
    
    section['lobbying_data'] = True
    section['is_lobbying_firm'] = is_lobbying_firm

    if is_lobbying_firm:
        section['lobbying_clients']   = api.org.registrant_clients(entity_id, cycle)
        section['lobbying_lobbyists'] = api.org.registrant_lobbyists(entity_id, cycle)
        section['lobbying_issues']    =  [item['issue'] for item in
                                       api.org.registrant_issues(entity_id, cycle)]
        section['lobbying_bills']     = [ {
            'bill': bill['bill_name'],
            'title': bill['title'],
            'link': make_bill_link(bill),
            'congress': bill['congress_no'],
        } for bill in api.org.registrant_bills(entity_id, cycle) ]
        section['lobbying_links'] = external_sites.get_lobbying_links('firm', name, external_ids, cycle)
    else:
        section['lobbying_clients']   = api.org.registrants(entity_id, cycle)
        section['lobbying_lobbyists'] = api.org.lobbyists(entity_id, cycle)
        section['lobbying_issues']    =  [item['issue'] for item in api.org.issues(entity_id, cycle)]
        section['lobbying_bills']     = [ {
            'bill': bill['bill_name'],
            'title': bill['title'],
            'link': make_bill_link(bill),
            'congress': bill['congress_no'],
        } for bill in api.org.bills(entity_id, cycle) ]
        
        section['lobbying_links'] = external_sites.get_lobbying_links('industry' if type == 'industry' else 'client', name, external_ids, cycle)

    section['lobbyist_registration_tracker'] = external_sites.get_lobbyist_tracker_data(external_ids)
    
    return section