class CommitteeReports(PdfMixin, BaseModel): __abstract__ = True committee_id = db.Column(db.String, index=True, doc=docs.COMMITTEE_ID) committee = utils.related('CommitteeHistory', 'committee_id', 'committee_id', 'report_year', 'cycle') cycle = db.Column(db.Integer, index=True, doc=docs.CYCLE) beginning_image_number = db.Column(db.BigInteger, doc=docs.BEGINNING_IMAGE_NUMBER) cash_on_hand_beginning_period = db.Column(db.Numeric(30, 2), doc=docs.CASH_ON_HAND_BEGIN_PERIOD)#P cash_on_hand_end_period = db.Column('cash_on_hand_end_period', db.Numeric(30, 2), doc=docs.CASH_ON_HAND_END_PERIOD)#P coverage_end_date = db.Column(db.DateTime, index=True, doc=docs.COVERAGE_END_DATE)#P coverage_start_date = db.Column(db.DateTime, index=True, doc=docs.COVERAGE_START_DATE)#P debts_owed_by_committee = db.Column('debts_owed_by_committee', db.Numeric(30, 2), doc=docs.DEBTS_OWED_BY_COMMITTEE)#P debts_owed_to_committee = db.Column(db.Numeric(30, 2), doc=docs.DEBTS_OWED_TO_COMMITTEE)#P end_image_number = db.Column(db.BigInteger, doc=docs.ENDING_IMAGE_NUMBER) other_disbursements_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.OTHER_DISBURSEMENTS))#PX other_disbursements_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.OTHER_DISBURSEMENTS))#PX other_political_committee_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS))#P other_political_committee_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS))#P political_party_committee_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS))#P political_party_committee_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS))#P report_type = db.Column(db.String, doc=docs.REPORT_TYPE) report_type_full = db.Column(db.String, doc=docs.REPORT_TYPE) report_year = db.Column(db.Integer, doc=docs.REPORT_YEAR) total_contribution_refunds_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.CONTRIBUTION_REFUNDS))#P total_contribution_refunds_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.CONTRIBUTION_REFUNDS))#P refunded_individual_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.REFUNDED_INDIVIDUAL_CONTRIBUTIONS))#P refunded_individual_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.REFUNDED_INDIVIDUAL_CONTRIBUTIONS))#P refunded_other_political_committee_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.REFUNDED_OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS))#P refunded_other_political_committee_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.REFUNDED_OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS))#P refunded_political_party_committee_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.REFUNDED_POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS))#P refunded_political_party_committee_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.REFUNDED_POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS))#P total_contributions_period = db.Column('total_contributions_period', db.Numeric(30, 2), doc=docs.add_period(docs.CONTRIBUTIONS))#P total_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.CONTRIBUTIONS))#P total_disbursements_period = db.Column('total_disbursements_period', db.Numeric(30, 2), doc=docs.add_period(docs.DISBURSEMENTS))#P total_disbursements_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.DISBURSEMENTS))#P total_receipts_period = db.Column('total_receipts_period', db.Numeric(30, 2), doc=docs.add_period(docs.RECEIPTS))#P total_receipts_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.RECEIPTS))#P offsets_to_operating_expenditures_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.OFFSETS_TO_OPERATING_EXPENDITURES))#P offsets_to_operating_expenditures_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.OFFSETS_TO_OPERATING_EXPENDITURES))#P total_individual_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_CONTRIBUTIONS))#P total_individual_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_CONTRIBUTIONS))#P individual_unitemized_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_UNITEMIZED_CONTRIBUTIONS))#P individual_unitemized_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_UNITEMIZED_CONTRIBUTIONS))#P individual_itemized_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_ITEMIZED_CONTRIBUTIONS))#P individual_itemized_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_ITEMIZED_CONTRIBUTIONS))#P is_amended = db.Column(db.Boolean, doc='False indicates that a report is the most recent. True indicates that the report has been superseded by an amendment.') receipt_date = db.Column('receipt_date', db.Date, doc=docs.RECEIPT_DATE) @property def document_description(self): return utils.document_description( self.coverage_end_date.year, clean_report_type(str(self.report_type_full)), None, None, )
class CommitteeReports(PdfMixin, BaseModel): __abstract__ = True report_key = db.Column(db.BigInteger) committee_id = db.Column(db.String, index=True) committee_key = db.Column(db.Integer, index=True) committee = utils.related('CommitteeHistory', 'committee_key', 'committee_key', 'report_year', 'cycle') cycle = db.Column(db.Integer, index=True) beginning_image_number = db.Column(db.BigInteger) cash_on_hand_beginning_period = db.Column(db.Integer) cash_on_hand_end_period = db.Column(db.Integer) coverage_end_date = db.Column(db.DateTime, index=True) coverage_start_date = db.Column(db.DateTime, index=True) debts_owed_by_committee = db.Column(db.Integer) debts_owed_to_committee = db.Column(db.Integer) end_image_number = db.Column(db.BigInteger) expire_date = db.Column(db.DateTime) other_disbursements_period = db.Column(db.Integer) other_disbursements_ytd = db.Column(db.Integer) other_political_committee_contributions_period = db.Column(db.Integer) other_political_committee_contributions_ytd = db.Column(db.Integer) political_party_committee_contributions_period = db.Column(db.Integer) political_party_committee_contributions_ytd = db.Column(db.Integer) report_type = db.Column(db.String) report_type_full = db.Column(db.String) report_year = db.Column(db.Integer) total_contribution_refunds_period = db.Column(db.Integer) total_contribution_refunds_ytd = db.Column(db.Integer) refunded_individual_contributions_period = db.Column(db.Integer) refunded_individual_contributions_ytd = db.Column(db.Integer) refunded_other_political_committee_contributions_period = db.Column(db.Integer) refunded_other_political_committee_contributions_ytd = db.Column(db.Integer) refunded_political_party_committee_contributions_period = db.Column(db.Integer) refunded_political_party_committee_contributions_ytd = db.Column(db.Integer) total_contributions_period = db.Column(db.Integer) total_contributions_ytd = db.Column(db.Integer) total_disbursements_period = db.Column(db.Integer) total_disbursements_ytd = db.Column(db.Integer) total_receipts_period = db.Column(db.Integer) total_receipts_ytd = db.Column(db.Integer) offsets_to_operating_expenditures_ytd = db.Column(db.Integer) offsets_to_operating_expenditures_period = db.Column(db.Integer) total_individual_contributions_ytd = db.Column(db.Integer) total_individual_contributions_period = db.Column(db.Integer) individual_unitemized_contributions_ytd = db.Column(db.Integer) individual_unitemized_contributions_period = db.Column(db.Integer) individual_itemized_contributions_ytd = db.Column(db.Integer) individual_itemized_contributions_period = db.Column(db.Integer)
class ScheduleBByRecipientID(BaseAggregate): __tablename__ = 'ofec_sched_b_aggregate_recipient_id' recipient_id = db.Column('recipient_cmte_id', db.String, primary_key=True, doc=docs.RECIPIENT_ID) committee = utils.related_committee('committee_id') recipient = utils.related('CommitteeHistory', 'recipient_id', 'committee_id', cycle_label='cycle') @property def committee_name(self): return self.committee.name @property def recipient_name(self): return self.recipient.name
class CommitteeReports(FecFileNumberMixin, PdfMixin, CsvMixin, BaseModel): __abstract__ = True committee_id = db.Column(db.String, index=True, doc=docs.COMMITTEE_ID) committee_name = db.Column(db.String, doc=docs.COMMITTEE_NAME) # mapped committee = utils.related('CommitteeHistory', 'committee_id', 'committee_id', 'report_year', 'cycle') # These columns derived from amendments materializeds view amendment_chain = db.Column(ARRAY(db.Numeric), doc=docs.AMENDMENT_CHAIN) previous_file_number = db.Column(db.Numeric) most_recent_file_number = db.Column(db.Numeric) cycle = db.Column(db.Integer, index=True, doc=docs.CYCLE) file_number = db.Column(db.Integer) amendment_indicator = db.Column('amendment_indicator', db.String) amendment_indicator_full = db.Column(db.String) beginning_image_number = db.Column(db.BigInteger, doc=docs.BEGINNING_IMAGE_NUMBER) cash_on_hand_beginning_period = db.Column( db.Numeric(30, 2), doc=docs.CASH_ON_HAND_BEGIN_PERIOD) # P cash_on_hand_end_period = db.Column('cash_on_hand_end_period', db.Numeric(30, 2), doc=docs.CASH_ON_HAND_END_PERIOD) # P coverage_end_date = db.Column(db.DateTime, index=True, doc=docs.COVERAGE_END_DATE) # P coverage_start_date = db.Column(db.DateTime, index=True, doc=docs.COVERAGE_START_DATE) # P debts_owed_by_committee = db.Column('debts_owed_by_committee', db.Numeric(30, 2), doc=docs.DEBTS_OWED_BY_COMMITTEE) # P debts_owed_to_committee = db.Column(db.Numeric(30, 2), doc=docs.DEBTS_OWED_TO_COMMITTEE) # P end_image_number = db.Column(db.BigInteger, doc=docs.ENDING_IMAGE_NUMBER) other_disbursements_period = db.Column(db.Numeric(30, 2), doc=docs.add_period( docs.OTHER_DISBURSEMENTS)) # PX other_disbursements_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd( docs.OTHER_DISBURSEMENTS)) # PX other_political_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS), ) # P other_political_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS), ) # P political_party_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS), ) # P political_party_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS), ) # P report_type = db.Column(db.String, doc=docs.REPORT_TYPE) report_type_full = db.Column(db.String, doc=docs.REPORT_TYPE) report_year = db.Column(db.Integer, doc=docs.REPORT_YEAR) total_contribution_refunds_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.CONTRIBUTION_REFUNDS)) # P total_contribution_refunds_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.CONTRIBUTION_REFUNDS)) # P refunded_individual_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.REFUNDED_INDIVIDUAL_CONTRIBUTIONS)) # P refunded_individual_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.REFUNDED_INDIVIDUAL_CONTRIBUTIONS)) # P refunded_other_political_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period( docs.REFUNDED_OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS), ) # P refunded_other_political_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd( docs.REFUNDED_OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS), ) # P refunded_political_party_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period( docs.REFUNDED_POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS), ) # P refunded_political_party_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd( docs.REFUNDED_POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS), ) # P total_contributions_period = db.Column( 'total_contributions_period', db.Numeric(30, 2), doc=docs.add_period(docs.CONTRIBUTIONS), ) # P total_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd( docs.CONTRIBUTIONS)) # P total_disbursements_period = db.Column( 'total_disbursements_period', db.Numeric(30, 2), doc=docs.add_period(docs.DISBURSEMENTS), ) # P total_disbursements_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd( docs.DISBURSEMENTS)) # P total_receipts_period = db.Column('total_receipts_period', db.Numeric(30, 2), doc=docs.add_period(docs.RECEIPTS)) # P total_receipts_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.RECEIPTS)) # P offsets_to_operating_expenditures_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.OFFSETS_TO_OPERATING_EXPENDITURES)) # P offsets_to_operating_expenditures_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.OFFSETS_TO_OPERATING_EXPENDITURES)) # P total_individual_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_CONTRIBUTIONS)) # P total_individual_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_CONTRIBUTIONS)) # P individual_unitemized_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_UNITEMIZED_CONTRIBUTIONS)) # P \ individual_unitemized_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_UNITEMIZED_CONTRIBUTIONS)) # P individual_itemized_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_ITEMIZED_CONTRIBUTIONS)) # P individual_itemized_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_ITEMIZED_CONTRIBUTIONS)) # P is_amended = db.Column('is_amended', db.Boolean, doc=docs.IS_AMENDED) receipt_date = db.Column('receipt_date', db.Date, doc=docs.RECEIPT_DATE) means_filed = db.Column('means_filed', db.String, doc=docs.MEANS_FILED) fec_url = db.Column(db.String, doc=docs.FEC_URL) html_url = db.Column(db.String, doc=docs.HTML_URL) most_recent = db.Column('most_recent', db.Boolean, doc=docs.MOST_RECENT) @property def document_description(self): return utils.document_description( self.coverage_end_date.year, clean_report_type(str(self.report_type_full)), None, None, )
class CommitteeReports(PdfMixin, BaseModel): __abstract__ = True committee_id = db.Column(db.String, index=True, doc=docs.COMMITTEE_ID) committee = utils.related('CommitteeHistory', 'committee_id', 'committee_id', 'report_year', 'cycle') cycle = db.Column(db.Integer, index=True, doc=docs.CYCLE) beginning_image_number = db.Column(db.BigInteger, doc=docs.BEGINNING_IMAGE_NUMBER) cash_on_hand_beginning_period = db.Column( db.Numeric(30, 2), doc=docs.CASH_ON_HAND_BEGIN_PERIOD) cash_on_hand_end_period = db.Column(db.Numeric(30, 2), doc=docs.CASH_ON_HAND_END_PERIOD) coverage_end_date = db.Column(db.DateTime, index=True, doc=docs.COVERAGE_END_DATE) coverage_start_date = db.Column(db.DateTime, index=True, doc=docs.COVERAGE_START_DATE) debts_owed_by_committee = db.Column(db.Numeric(30, 2), doc=docs.DEBTS_OWED_BY_COMMITTEE) debts_owed_to_committee = db.Column(db.Numeric(30, 2), doc=docs.DEBTS_OWED_TO_COMMITTEE) end_image_number = db.Column(db.BigInteger, doc=docs.ENDING_IMAGE_NUMBER) expire_date = db.Column(db.DateTime) other_disbursements_period = db.Column(db.Numeric(30, 2), doc=docs.add_period( docs.OTHER_DISBURSEMENTS)) other_disbursements_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd( docs.OTHER_DISBURSEMENTS)) other_political_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS)) other_political_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS)) political_party_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS)) political_party_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS)) report_type = db.Column(db.String, doc=docs.REPORT_TYPE) report_type_full = db.Column(db.String, doc=docs.REPORT_TYPE) report_year = db.Column(db.Integer, doc=docs.REPORT_YEAR) total_contribution_refunds_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.CONTRIBUTION_REFUNDS)) total_contribution_refunds_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd( docs.CONTRIBUTION_REFUNDS)) refunded_individual_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.REFUNDED_INDIVIDUAL_CONTRIBUTIONS)) refunded_individual_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.REFUNDED_INDIVIDUAL_CONTRIBUTIONS)) refunded_other_political_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period( docs.REFUNDED_OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS)) refunded_other_political_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd( docs.REFUNDED_OTHER_POLITICAL_COMMITTEE_CONTRIBUTIONS)) refunded_political_party_committee_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period( docs.REFUNDED_POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS)) refunded_political_party_committee_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd( docs.REFUNDED_POLITICAL_PARTY_COMMITTEE_CONTRIBUTIONS)) total_contributions_period = db.Column(db.Numeric(30, 2), doc=docs.add_period( docs.CONTRIBUTIONS)) total_contributions_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.CONTRIBUTIONS)) total_disbursements_period = db.Column(db.Numeric(30, 2), doc=docs.add_period( docs.DISBURSEMENTS)) total_disbursements_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.DISBURSEMENTS)) total_receipts_period = db.Column(db.Numeric(30, 2), doc=docs.add_period(docs.RECEIPTS)) total_receipts_ytd = db.Column(db.Numeric(30, 2), doc=docs.add_ytd(docs.RECEIPTS)) offsets_to_operating_expenditures_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.OFFSETS_TO_OPERATING_EXPENDITURES)) offsets_to_operating_expenditures_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.OFFSETS_TO_OPERATING_EXPENDITURES)) total_individual_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_CONTRIBUTIONS)) total_individual_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_CONTRIBUTIONS)) individual_unitemized_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_UNITEMIZED_CONTRIBUTIONS)) individual_unitemized_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_UNITEMIZED_CONTRIBUTIONS)) individual_itemized_contributions_ytd = db.Column( db.Numeric(30, 2), doc=docs.add_ytd(docs.INDIVIDUAL_ITEMIZED_CONTRIBUTIONS)) individual_itemized_contributions_period = db.Column( db.Numeric(30, 2), doc=docs.add_period(docs.INDIVIDUAL_ITEMIZED_CONTRIBUTIONS))