Exemple #1
0
class RawCommitteeTransactionsAmmendedTransactions(models.Model):
    #TODO:  what does 'amended' mean?  Any reason to keep this table?
    tran_id = models.IntegerField(blank=True, primary_key=True)
    original_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    tran_status = models.LongCharField(max_length=-1, blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1,
                                             blank=True,
                                             null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    aggregate_amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    attest_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    attest_date = models.DateField(blank=True, null=True)
    review_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    review_date = models.DateField(blank=True, null=True)
    due_date = models.DateField(blank=True, null=True)
    occptn_ltr_date = models.LongCharField(max_length=-1,
                                           blank=True,
                                           null=True)
    pymt_sched_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    intrst_rate = models.LongCharField(max_length=-1, blank=True, null=True)
    check_nbr = models.LongCharField(max_length=-1, blank=True, null=True)
    tran_stsfd_ind = models.NullBooleanField()
    filed_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_book_agent_name = models.LongCharField(max_length=-1,
                                                blank=True,
                                                null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    title_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    occptn_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_name = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_city = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_state = models.LongCharField(max_length=-1, blank=True, null=True)
    employ_ind = models.NullBooleanField()
    self_employ_ind = models.NullBooleanField()
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    zip_plus_four = models.IntegerField(blank=True, null=True)
    county = models.LongCharField(max_length=-1, blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    exp_date = models.LongCharField(max_length=-1, blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        verbose_name = 'ammended transaction'
        verbose_name_plural = 'ammended transactions'
        managed = False
        db_table = 'raw_committee_transactions_ammended_transactions'
class CommitteeTransactions(models.Model):
    """Committee transactions cleaned with Grimm's migration

    Intended for use in aggregates displayed to the user.
    Other transaction tables are dirty (contain transaction ammendments with the same "original_id").
    """
    tran_id = models.IntegerField(blank=True, primary_key=True, default=0)
    original_id = models.IntegerField(blank=True)
    tran_date = models.DateField(blank=True, null=True)
    tran_status = models.LongCharField(max_length=-1, blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1, blank=True, null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    aggregate_amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    attest_by_name = models.LongCharField(max_length=-1)
    attest_date = models.DateField()
    review_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    review_date = models.DateField(blank=True, null=True)
    due_date = models.DateField(blank=True, null=True)
    occptn_ltr_date = models.LongCharField(max_length=-1, blank=True, null=True)
    pymt_sched_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    intrst_rate = models.LongCharField(max_length=-1, blank=True, null=True)
    check_nbr = models.LongCharField(max_length=-1, blank=True, null=True)
    tran_stsfd_ind = models.NullBooleanField()
    filed_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_book_agent_name = models.LongCharField(max_length=-1, blank=True, null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    title_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    occptn_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_name = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_city = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_state = models.LongCharField(max_length=-1, blank=True, null=True)
    employ_ind = models.NullBooleanField()
    self_employ_ind = models.NullBooleanField()
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    zip_plus_four = models.IntegerField(blank=True, null=True)
    county = models.LongCharField(max_length=-1, blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    exp_date = models.LongCharField(max_length=-1, blank=True, null=True)

    IMPORTANT_FIELDS = ['tran_id', 'tran_date', 'filer_id', 'filer', 'contributor_payee', 'amount',
                        'direction', 'purpose_codes']

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        verbose_name = 'transaction'
        verbose_name_plural = 'transactions'
        managed = True
class CampaignDetail(models.Model):
    filer_id = models.IntegerField(primary_key=True, default=0)
    candidate_name = models.TextField(blank=True, null=True)
    committee_name = models.LongCharField(max_length=-1, blank=True, null=True)
    race = models.TextField(blank=True, null=True)
    website = models.TextField(blank=True, null=True)
    phone = models.LongCharField(max_length=-1, blank=True, null=True)
    total = models.FloatField(blank=True, null=True)
    total_spent = models.FloatField(blank=True, null=True)
    grassroots = models.FloatField(blank=True, null=True)
    instate = models.FloatField(blank=True, null=True)
    election = models.TextField(blank=True, null=True)
    party = models.TextField(blank=True, null=True)
    num_transactions = models.BigIntegerField(blank=True, null=True)
    committee_type = models.LongCharField(max_length=-1, blank=True, null=True)
    committee_subtype = models.LongCharField(max_length=-1, blank=True, null=True)
    db_update_status = models.TextField(blank=True, null=True)

    IMPORTANT_FIELDS = ['filer_id', 'committee_name', 'committee_type', 'committee_subtype',
                        'candidate_name', 'website', 'party', 'race']

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = True
        db_table = 'campaign_detail'
Exemple #4
0
class CampaignDetail(models.Model):
    filer_id = models.IntegerField(
        primary_key=True,
        default=0,
        help_text="2384 unique integers identifying each committee.")
    candidate_name = models.TextField(
        blank=True,
        null=True,
        help_text="Not unique_together (candidate_name, committee_name, race)."
    )
    committee_name = models.LongCharField(
        max_length=-1,
        blank=True,
        null=True,
        help_text='Nonunique identifying name.')
    race = models.TextField(blank=True, null=True)
    website = models.TextField(blank=True, null=True)
    phone = models.LongCharField(max_length=-1, blank=True, null=True)
    total = models.FloatField(blank=True, null=True)
    total_spent = models.FloatField(blank=True, null=True)
    grassroots = models.FloatField(blank=True, null=True)
    instate = models.FloatField(blank=True, null=True)
    election = models.TextField(blank=True, null=True)
    party = models.TextField(blank=True, null=True)
    num_transactions = models.BigIntegerField(blank=True, null=True)
    committee_type = models.LongCharField(max_length=-1, blank=True, null=True)
    committee_subtype = models.LongCharField(max_length=-1,
                                             blank=True,
                                             null=True)
    db_update_status = models.TextField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'campaign_detail'
class RawCommitteeTransactions(models.Model):
    """Comittee transactions scrapped directly from OR-Star without any cleaning/deduping."""
    tran_id = models.IntegerField(primary_key=True, default=0, null=False)
    original_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    tran_status = models.LongCharField(max_length=-1, blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1, blank=True, null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    aggregate_amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    attest_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    attest_date = models.DateField(blank=True, null=True)
    review_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    review_date = models.DateField(blank=True, null=True)
    due_date = models.DateField(blank=True, null=True)
    occptn_ltr_date = models.LongCharField(max_length=-1, blank=True, null=True)
    pymt_sched_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    intrst_rate = models.LongCharField(max_length=-1, blank=True, null=True)
    check_nbr = models.LongCharField(max_length=-1, blank=True, null=True)
    tran_stsfd_ind = models.NullBooleanField()
    filed_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_book_agent_name = models.LongCharField(max_length=-1, blank=True, null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    title_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    occptn_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_name = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_city = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_state = models.LongCharField(max_length=-1, blank=True, null=True)
    employ_ind = models.NullBooleanField()
    self_employ_ind = models.NullBooleanField()
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    zip_plus_four = models.IntegerField(blank=True, null=True)
    county = models.LongCharField(max_length=-1, blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    exp_date = models.LongCharField(max_length=-1, blank=True, null=True)

    IMPORTANT_FIELDS = ['tran_id', 'tran_date', 'filer_id', 'filer', 'contributor_payee', 'amount',
                        'direction', 'purpose_codes']

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        verbose_name = 'raw transaction'
        verbose_name_plural = 'raw transactions'
        db_table = 'raw_committee_transactions'
class CandidateSumByDate(models.Model):
    filer_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    total_in = models.FloatField(blank=True, null=True)
    total_out = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'candidate_sum_by_date'
class RawCommitteeTransactionsErrors(models.Model):
    tran_id = models.IntegerField(blank=True, null=True)
    original_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    tran_status = models.LongCharField(max_length=-1, blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1,
                                             blank=True,
                                             null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    aggregate_amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    attest_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    attest_date = models.DateField(blank=True, null=True)
    review_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    review_date = models.DateField(blank=True, null=True)
    due_date = models.DateField(blank=True, null=True)
    occptn_ltr_date = models.LongCharField(max_length=-1,
                                           blank=True,
                                           null=True)
    pymt_sched_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    intrst_rate = models.LongCharField(max_length=-1, blank=True, null=True)
    check_nbr = models.LongCharField(max_length=-1, blank=True, null=True)
    tran_stsfd_ind = models.NullBooleanField()
    filed_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_book_agent_name = models.LongCharField(max_length=-1,
                                                blank=True,
                                                null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    title_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    occptn_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_name = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_city = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_state = models.LongCharField(max_length=-1, blank=True, null=True)
    employ_ind = models.NullBooleanField()
    self_employ_ind = models.NullBooleanField()
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    zip_plus_four = models.IntegerField(blank=True, null=True)
    county = models.LongCharField(max_length=-1, blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    exp_date = models.LongCharField(max_length=-1, blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'raw_committee_transactions_errors'
class AcGrassRootsInState(models.Model):
    filer_id = models.FloatField(blank=True, null=True)
    filer = models.TextField(blank=True, null=True)
    candidate_name = models.TextField(blank=True, null=True)
    total_money = models.FloatField(blank=True, null=True)
    percent_grassroots = models.FloatField(blank=True, null=True)
    percent_instate = models.FloatField(blank=True, null=True)
    total_money_out = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'ac_grass_roots_in_state'
class CandidateSumByDate(models.Model):
    filer_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    total_in = models.FloatField(blank=True, null=True)
    total_out = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = False
        db_table = 'candidate_sum_by_date'
Exemple #10
0
class RawCommitteeTransactions(models.Model):
    tran_id = models.IntegerField(blank=True, null=True,
        help_text='A single transaction can have multiple tran_ids due to revisions/corrections.')
    original_id = models.IntegerField(blank=True, null=True,
        help_text='Nonunique because amendments/corrections must refer to the same original_id.')
    tran_date = models.DateField(blank=True, null=True)
    tran_status = models.LongCharField(max_length=-1, blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1, blank=True, null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    aggregate_amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True,
                                   help_text="Unique identifier of a Committee (CommitteeDetail FK)")
    attest_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    attest_date = models.DateField(blank=True, null=True)
    review_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    review_date = models.DateField(blank=True, null=True)
    due_date = models.DateField(blank=True, null=True)
    occptn_ltr_date = models.LongCharField(max_length=-1, blank=True, null=True)
    pymt_sched_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    intrst_rate = models.LongCharField(max_length=-1, blank=True, null=True)
    check_nbr = models.LongCharField(max_length=-1, blank=True, null=True)
    tran_stsfd_ind = models.NullBooleanField()
    filed_by_name = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_book_agent_name = models.LongCharField(max_length=-1, blank=True, null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    title_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    occptn_txt = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_name = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_city = models.LongCharField(max_length=-1, blank=True, null=True)
    emp_state = models.LongCharField(max_length=-1, blank=True, null=True)
    employ_ind = models.NullBooleanField()
    self_employ_ind = models.NullBooleanField()
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    zip_plus_four = models.IntegerField(blank=True, null=True)
    county = models.LongCharField(max_length=-1, blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    exp_date = models.LongCharField(max_length=-1, blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'raw_committee_transactions'
Exemple #11
0
class CandidateSumByDate(models.Model):
    filer_id = models.IntegerField(blank=True, primary_key=True)
    tran_date = models.DateField(blank=True, null=True)
    total_in = models.FloatField(blank=True, null=True)
    total_out = models.FloatField(blank=True, null=True)

    IMPORTANT_FIELDS = ['filer_id', 'total_in', 'total_out']

    def __str__(self):
        return representation(self)

    class Meta:
        verbose_name_plural = 'candidate sums by date'
        managed = False
        db_table = 'candidate_sum_by_date'
Exemple #12
0
class AcGrassRootsInState(models.Model):
    filer_id = models.FloatField(blank=True, primary_key=True)
    filer = models.TextField(blank=True, null=True)
    candidate_name = models.TextField(blank=True, null=True)
    total_money = models.FloatField(blank=True, null=True)
    percent_grassroots = models.FloatField(blank=True, null=True)
    percent_instate = models.FloatField(blank=True, null=True)
    total_money_out = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        managed = False
        db_table = 'ac_grass_roots_in_state'
class WorkingTransactions(models.Model):
    tran_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1,
                                             blank=True,
                                             null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    direction = models.CharField(max_length=7, blank=True, null=True)
    contributor_payee_class = models.LongCharField(max_length=-1,
                                                   blank=True,
                                                   null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'working_transactions'
class WorkingTransactions(models.Model):
    tran_id = models.IntegerField(blank=True, null=True)
    tran_date = models.DateField(blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1, blank=True, null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    direction = models.CharField(max_length=7, blank=True, null=True)
    contributor_payee_class = models.LongCharField(max_length=-1, blank=True, null=True)

    IMPORTANT_FIELDS = ['tran_id', 'tran_date', 'filer_id', 'filer', 'filed_date', 'amount',
                        'direction', 'purpose_codes']

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        verbose_name = 'working transaction'
        verbose_name_plural = 'working transactions'
        managed = False
        db_table = 'cc_working_transactions'
Exemple #15
0
class WorkingTransactions(models.Model):
    tran_id = models.IntegerField(blank=True, primary_key=True, null=False)
    tran_date = models.DateField(blank=True, null=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee = models.LongCharField(max_length=-1,
                                             blank=True,
                                             null=True)
    sub_type = models.LongCharField(max_length=-1, blank=True, null=True)
    amount = models.FloatField(blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    purp_desc = models.LongCharField(max_length=-1, blank=True, null=True)
    book_type = models.LongCharField(max_length=-1, blank=True, null=True)
    addr_line1 = models.LongCharField(max_length=-1, blank=True, null=True)
    filed_date = models.DateField(blank=True, null=True)
    addr_line2 = models.LongCharField(max_length=-1, blank=True, null=True)
    city = models.LongCharField(max_length=-1, blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    zip = models.IntegerField(blank=True, null=True)
    purpose_codes = models.LongCharField(max_length=-1, blank=True, null=True)
    direction = models.CharField(max_length=7, blank=True, null=True)
    contributor_payee_class = models.LongCharField(max_length=-1,
                                                   blank=True,
                                                   null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        managed = False
        db_table = 'working_transactions'
class AcGrassRootsInState(models.Model):
    """filer_id is not unique so it cannot be made PK"""
    filer_id = models.FloatField(blank=True, null=True)
    filer = models.TextField(blank=True, null=True)
    candidate_name = models.TextField(blank=True, null=True)
    total_money = models.FloatField(blank=True, null=True)
    percent_grassroots = models.FloatField(blank=True, null=True)
    percent_instate = models.FloatField(blank=True, null=True)
    total_money_out = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = False
        db_table = 'ac_grass_roots_in_state'
class OregonByContributions(models.Model):
    contribution_type = models.LongCharField(max_length=-1, blank=True, null=True)
    total = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'oregon_by_contributions'
class OregonByPurposeCodes(models.Model):
    purpose_code = models.TextField(blank=True, null=True)
    total = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'oregon_by_purpose_codes'
Exemple #19
0
class CcGrassRootsInState(models.Model):
    filer_id = models.IntegerField(blank=True, primary_key=True)
    filer = models.LongCharField(max_length=-1, blank=True, null=True)
    num_transactions = models.BigIntegerField(blank=True, null=True)
    in_state = models.FloatField(blank=True, null=True)
    grass_roots = models.FloatField(blank=True, null=True)
    total_contributions = models.FloatField(blank=True, null=True)
    total_money = models.FloatField(blank=True, null=True)
    total_money_out = models.FloatField(blank=True, null=True)
    percent_grass_roots = models.FloatField(blank=True, null=True)
    percent_in_state = models.FloatField(blank=True, null=True)

    IMPORTANT_FIELDS = [
        'filer_id', 'filer', 'total_money', 'percent_grass_roots',
        'percent_in_state'
    ]

    def __str__(self):
        return representation(self)

    class Meta:
        verbose_name = 'grass roots in-state total'
        verbose_name_plural = 'grass roots in-state totals'

        managed = False
        db_table = 'cc_grass_roots_in_state'
class OregonCommitteeAgg(models.Model):
    contributor_payee = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    sum = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'oregon_committee_agg'
class OregonByPurposeCodes(models.Model):
    purpose_code = models.TextField(blank=True, null=True)
    total = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = False
        db_table = 'oregon_by_purpose_codes'
class OregonByContributions(models.Model):
    contribution_type = models.LongCharField(max_length=-1, blank=True, null=True)
    total = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = False
        db_table = 'oregon_by_contributions'
class CandidateByState(models.Model):
    candidate_name = models.TextField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    direction = models.CharField(max_length=7, blank=True, null=True)
    value = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'candidate_by_state'
class OregonCommitteeAgg(models.Model):
    contributor_payee = models.LongCharField(max_length=-1, blank=True, null=True)
    contributor_payee_committee_id = models.IntegerField(blank=True, null=True)
    sum = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = False
        db_table = 'oregon_committee_agg'
class StateSumByDate(models.Model):
    tran_date = models.DateField(blank=True, null=True)
    total_in = models.FloatField(blank=True, null=True)
    total_out = models.FloatField(blank=True, null=True)
    total_from_within = models.FloatField(blank=True, null=True)
    total_to_within = models.FloatField(blank=True, null=True)
    total_from_the_outside = models.FloatField(blank=True, null=True)
    total_to_the_outside = models.FloatField(blank=True, null=True)
    total_grass_roots = models.FloatField(blank=True, null=True)
    total_from_in_state = models.FloatField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'state_sum_by_date'
class AllOregonSum(models.Model):
    in_field = models.FloatField(db_column='in', blank=True, null=True)  # Field renamed because it was a Python reserved word.
    out = models.FloatField(blank=True, null=True)
    from_within = models.FloatField(blank=True, null=True)
    to_within = models.FloatField(blank=True, null=True)
    from_outside = models.FloatField(blank=True, null=True)
    to_outside = models.FloatField(blank=True, null=True)
    total_grass_roots = models.FloatField(blank=True, null=True)
    total_from_in_state = models.FloatField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'all_oregon_sum'
Exemple #27
0
class OregonByPurposeCodes(models.Model):
    purpose_code = models.TextField(blank=True, primary_key=True)
    total = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        verbose_name = 'purpose'
        verbose_name_plural = 'purposes'

        managed = False
        db_table = 'oregon_by_purpose_codes'
class CandidateByState(models.Model):
    candidate_name = models.TextField(blank=True, null=True)
    filer_id = models.IntegerField(blank=True, null=True)
    state = models.LongCharField(max_length=-1, blank=True, null=True)
    direction = models.CharField(max_length=7, blank=True, null=True)
    value = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        app_label = 'pacs'
        managed = False
        db_table = 'candidate_by_state'
Exemple #29
0
class OregonByContributions(models.Model):
    contribution_type = models.LongCharField(max_length=-1,
                                             blank=True,
                                             primary_key=True)
    total = models.FloatField(blank=True, null=True)

    def __str__(self):
        return representation(self)

    class Meta:
        verbose_name = 'contribution type'
        verbose_name_plural = 'contribution types'
        managed = False
        db_table = 'oregon_by_contributions'
class CampaignDetail(models.Model):
    filer_id = models.IntegerField(primary_key=True, default=0)
    candidate_name = models.TextField(blank=True, null=True)
    committee_name = models.LongCharField(max_length=-1, blank=True, null=True)
    race = models.TextField(blank=True, null=True)
    website = models.TextField(blank=True, null=True)
    phone = models.LongCharField(max_length=-1, blank=True, null=True)
    total = models.FloatField(blank=True, null=True)
    total_spent = models.FloatField(blank=True, null=True)
    grassroots = models.FloatField(blank=True, null=True)
    instate = models.FloatField(blank=True, null=True)
    election = models.TextField(blank=True, null=True)
    party = models.TextField(blank=True, null=True)
    num_transactions = models.BigIntegerField(blank=True, null=True)
    committee_type = models.LongCharField(max_length=-1, blank=True, null=True)
    committee_subtype = models.LongCharField(max_length=-1,
                                             blank=True,
                                             null=True)
    db_update_status = models.TextField(blank=True, null=True)

    class Meta:
        managed = True
        app_label = 'pacs'
        db_table = 'campaign_detail'