Skip to content

Commit 5df232a

Browse files
committed
Add descriptions
1 parent 4420c97 commit 5df232a

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

webservices/common/models/large_aggregates.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class EntityReceiptDisbursementTotals(db.Model):
1212
cycle = db.Column(db.Integer, doc=docs.RECORD_CYCLE)
1313
month = db.Column(db.Integer, doc="Numeric representation of year")
1414
year = db.Column(db.Integer, doc="Numeric representation of month")
15-
end_date = db.Column(db.Date, doc="Date representation of the month and year")
15+
end_date = db.Column(db.Date)
1616
cumulative_candidate_receipts = db.Column(
1717
db.Float,
1818
doc="Cumulative candidate receipts in a two year period, adjusted to avoid double counting.",

webservices/docs.py

+8
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@
714714
MAX_UPDATE_DATE = '''
715715
The maximum date this record was last updated.(MM/DD/YYYY or YYYY-MM-DD)
716716
'''
717+
718+
CANDIDATE_PCC_ID = 'The candidate\'s primary campaign committee ID'
719+
720+
CANDIDATE_PCC_NAME = 'The candidate\'s primary campaign committee name'
717721
# ======== election end ===========
718722

719723

@@ -1270,6 +1274,8 @@
12701274
Date the event ends(MM/DD/YYYY or YYYY-MM-DD)
12711275
'''
12721276

1277+
END_DATE_ENTITY_CHART = 'The cumulative total for this month.'
1278+
12731279
CALENDAR_EXPORT = '''
12741280
Returns CSV or ICS for downloading directly into calendar applications like Google, Outlook or other applications.
12751281
@@ -1542,6 +1548,8 @@
15421548
CONTRIBUTOR_EMPLOYER = 'Employer of contributor, filers need to make an effort to gather this information'
15431549
CONTRIBUTOR_OCCUPATION = 'Occupation of contributor, filers need to make an effort to gather this information'
15441550
CONTRIBUTOR_ZIP = 'Zip code of contributor'
1551+
CONTRIBUTOR_AGGREGATE_YTD = 'Total amount received from this source for the year to date. \
1552+
Starting 2000, it is aggregated on an election-cycle basis in F3 and F3P, and calendar year in F3X.'
15451553
IS_INDIVIDUAL = 'Restrict to non-earmarked individual contributions where memo code is true. \
15461554
Filtering individuals is useful to make sure contributions are not double reported and in creating \
15471555
breakdowns of the amount of money coming from individuals.'

webservices/schemas.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from marshmallow_sqlalchemy import SQLAlchemySchema, SQLAlchemyAutoSchema
88
from marshmallow_pagination import schemas as paging_schemas
99

10-
from webservices import utils, decoders
10+
from webservices import utils, decoders, docs
1111
from webservices.spec import spec
1212
from webservices.common import models
1313
from webservices import __API_VERSION__
@@ -999,7 +999,7 @@ class CandidateHistoryTotalSchema(schemas['CandidateHistorySchema'],
999999
'committee': ma.fields.Nested(schemas['CommitteeHistorySchema']),
10001000
'contributor': ma.fields.Nested(schemas['CommitteeHistorySchema']),
10011001
'contribution_receipt_amount': ma.fields.Float(),
1002-
'contributor_aggregate_ytd': ma.fields.Float(),
1002+
'contributor_aggregate_ytd': ma.fields.Float(description=docs.CONTRIBUTOR_AGGREGATE_YTD),
10031003
'image_number': ma.fields.Str(),
10041004
'original_sub_id': ma.fields.Str(),
10051005
'sub_id': ma.fields.Str(),
@@ -1610,8 +1610,8 @@ class ElectionSchema(ma.Schema):
16101610
incumbent_challenge_full = ma.fields.Str()
16111611
party_full = ma.fields.Str()
16121612
committee_ids = ma.fields.List(ma.fields.Str)
1613-
candidate_pcc_id = ma.fields.Str(doc="The candidate's primary campaign committee ID")
1614-
candidate_pcc_name = ma.fields.Str(doc="The candidate's primary campaign committee name")
1613+
candidate_pcc_id = ma.fields.Str(description=docs.CANDIDATE_PCC_ID)
1614+
candidate_pcc_name = ma.fields.Str(description=docs.CANDIDATE_PCC_NAME)
16151615
total_receipts = ma.fields.Float()
16161616
total_disbursements = ma.fields.Float()
16171617
cash_on_hand_end_period = ma.fields.Float()
@@ -1675,7 +1675,7 @@ class TotalsCommitteeSchema(schemas['CommitteeHistorySchema']):
16751675
EntityReceiptDisbursementTotalsSchema = make_schema(
16761676
models.EntityReceiptDisbursementTotals,
16771677
options={'exclude': ('idx', 'month', 'year')},
1678-
fields={'end_date': ma.fields.Date(doc='The cumulative total for this month.')},
1678+
fields={'end_date': ma.fields.Date(description=docs.END_DATE_ENTITY_CHART)}
16791679
)
16801680
EntityReceiptDisbursementTotalsPageSchema = make_page_schema(EntityReceiptDisbursementTotalsSchema)
16811681
register_schema(EntityReceiptDisbursementTotalsSchema)

0 commit comments

Comments
 (0)