Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ilcampaigncash/processors/lib/models.py /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
79 lines (52 sloc)
1.3 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ISBOEModel(object): | |
| def __init__(self, row): | |
| self.row = row | |
| self.validate() | |
| def validate(self): | |
| """ | |
| Must raise errors for invalid rows | |
| """ | |
| raise NotImplementedError | |
| def clean(self, row): | |
| return {k: v.strip() for k, v in row.items() if k and v} | |
| def serialize(self): | |
| return self.clean(self.row) | |
| class Candidate(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class CanElection(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class CmteCandidateLink(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class CmteOfficerLink(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class Committee(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class D2Total(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class Expenditure(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class FiledDoc(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class Investment(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class Officer(ISBOEModel): | |
| def validate(self): | |
| pass | |
| # int(self.row['CommitteeID']) | |
| class PrevOfficer(ISBOEModel): | |
| def validate(self): | |
| pass | |
| class Receipt(ISBOEModel): | |
| def validate(self): | |
| # Some rows are shifted | |
| int(self.row['ID']) | |
| int(self.row['CommitteeID']) |