def fetch(self): entity_id, cycle, type, external_ids = self.entity.entity_id, self.entity.cycle, self.entity.type, self.entity.external_ids self.entity_is_lobbying_firm = bool(self.entity.metadata['entity_info']['metadata'].get('lobbying_firm', False)) if self.entity_is_lobbying_firm: self.lobbying_clients = api.org.registrant_clients(entity_id, cycle) self.lobbying_lobbyists = api.org.registrant_lobbyists(entity_id, cycle) self.data['lobbying_issues'] = api.org.registrant_issues(entity_id, cycle) self.data['lobbying_bills'] = api.org.registrant_bills(entity_id, cycle) else: self.lobbying_clients = api.org.registrants(entity_id, cycle) self.lobbying_lobbyists = api.org.lobbyists(entity_id, cycle) self.data['lobbying_issues'] = api.org.issues(entity_id, cycle) self.data['lobbying_bills'] = api.org.bills(entity_id, cycle) self.lobbyist_registration_tracker = external_sites.get_lobbyist_tracker_data(external_ids) return True
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
def fetch(self): entity_id, cycle, type, external_ids = self.entity.entity_id, self.entity.cycle, self.entity.type, self.entity.external_ids self.entity_is_lobbying_firm = bool( self.entity.metadata['entity_info']['metadata'].get( 'lobbying_firm', False)) if self.entity_is_lobbying_firm: self.lobbying_clients = api.org.registrant_clients( entity_id, cycle) self.lobbying_lobbyists = api.org.registrant_lobbyists( entity_id, cycle) self.data['lobbying_issues'] = api.org.registrant_issues( entity_id, cycle) self.data['lobbying_bills'] = api.org.registrant_bills( entity_id, cycle) else: self.lobbying_clients = api.org.registrants(entity_id, cycle) self.lobbying_lobbyists = api.org.lobbyists(entity_id, cycle) self.data['lobbying_issues'] = api.org.issues(entity_id, cycle) self.data['lobbying_bills'] = api.org.bills(entity_id, cycle) self.lobbyist_registration_tracker = external_sites.get_lobbyist_tracker_data( external_ids) return True