Skip to content

Instantly share code, notes, and snippets.

@mojowen
Created October 26, 2012 21:51
Show Gist options
  • Save mojowen/3961783 to your computer and use it in GitHub Desktop.
Save mojowen/3961783 to your computer and use it in GitHub Desktop.
Ballot Data Models
[
{ // Example of a Candidate Race
// The name of the particular race or ballot measure
"contest": "US House",
// The type, can be Federal, State, County, Other, Ballot_Statewide (catch-all for ballot measures), User_Candidate, User_Measure (both are user-generated content)
"contest_type": "Federal",
// Name of the race - auto generated for candidates
"description": "David Kaiser vs. Steve Daines vs. Kim Gillan",
// The poitical geography of the race
"geography": "MT",
// Human readable version of the geography
"nice_geography": "Montana",
// Number of votes that can be cast for this election
"votes": 1,
// The options for this race - because this is for an elected official it's a list of candidates
"options": [
{
// The candidates name
"name": "David Kaiser",
"option_type": "Open Seat",
// A comma separated list of their party
"party": "Libertarian",
// The # of votes they've recieved in support
"support": 1,
// The number of comments for this particular race
"comments": 1,
// Twitter URL
"twitter": "",
// Their web site
"website": "http://Vote4you.us"
// Facebook URL
"facebook": "",
// Faces are up to four people who support this candidate - their photos, name, and the URL to their voter guide
"faces": [
{
"name": "Tim Martin",
"image": "http://graph.facebook.com/1098731695/picture?type=square",
"url": "/422945d7"
}
],
// Comments made in support of this candidate
"feedbacks": [
{
// The Comment
"comment": "We cannot solve our problems with the same kind of thinking we used when we created them. Insanity is doing the same thing over and over again and expecting different results. We have tried the Democrat/Republican leaders the last 100 years. I don't like their results. It's time to try something different.",
"cached_votes_down": 0, // # of people who find it not useful
"cached_votes_total": 1,
"cached_votes_up": 1, // # of people who find it useful
"user": { // The user who made this comment
"description": null, // A description of their voter guide
"fb": "1098731695", // Their facebook ID
"first_name": "Tim",
"guide_name": null,
"image": "http://graph.facebook.com/1098731695/picture?type=square", // Facebook Profile Pic
"last_name": "Martin",
"name": "Tim Martin",
"profile": "/422945d7", // URL to their voter guide
}
"updated_at": "2012-10-15T17:31:07Z",
"created_at": "2012-10-11T12:09:18Z",
"id": 2104,
}
],
"id": 39704,
"incumbant": false,
"photo": "", // Not used
"position": null, // Not used
"updated_at": "2012-09-07T16:10:12Z",
"created_at": "2012-09-02T23:08:10Z"
},
...
],
// Not in use
"commentable": false,
"created_at": "2012-09-02T23:08:10Z",
"id": 22663,
"order": null,
"updated_at": "2012-09-07T16:11:28Z",
},
{ // Example of a Ballot Measure - I've only marked up the sections that are markedly different than candidates
// The name of the Ballot Measure
"contest": "LR-120",
// All Ballot Measures are classified as Ballot_Statewide (just go with it)
"contest_type": "Ballot_Statewide",
// A description of the law - to the best of our abilities
"description": "Prohibits a physician from performing an abortion on a minor under 16 years of age unless a physician notifies a parent or legal guardian of the minor at least 48 hours prior to the procedure. Notice is not required if: (1) there is a medical emergency; (2) it is waived by a youth court in a sealed proceeding; or (3) it is waived by the parent or guardian. A person who performs an abortion in violation of the act, or who coerces a minor to have an abortion, is subject to criminal prosecution and civil liability.",
// The geography - most are statewide but some are specific to cities or counties
"geography": "MT",
"nice_geography": "Montana",
"votes": 1,
"options": [ // There are two options for every Ballot Measure - a "Yes" and a "No" vote (although specific language will vary)
{
// The ballot specific language of this vote
"name": "For",
// Will either be "yes" or "no"
"option_type": "yes",
// Our best attempt at describing what happens with "yes" vote
"blurb": "Requires parental notification prior to abortion for a minor, providing for judicial waiver of notification, repealing prior statutes, and providing penalties.",
// The full text of the measure - as provided by the SOS
"blurb_source": "http://sos.mt.gov/Elections/2012/BallotIssues/LR-120.pdf",
"comments": 1,
"support": 1,
"created_at": "2012-09-03T00:53:30Z",
"faces": [...],
"feedbacks": [...],
"id": 46871,
// Not used - ignore all of tehse
"facebook": "",
"incumbant": false,
"party": "",
"photo": "",
"position": null,
"twitter": "",
"updated_at": "2012-09-10T18:54:38Z",
"website": ""
},
{
"name": "Against", // Ballot specific language
"option_type": "no", // No type
"blurb": "Rejects requirement parental notification prior to abortion for a minor, providing for judicial waiver of notification, repealing prior statutes, and providing penalties.",
"blurb_source": "http://sos.mt.gov/Elections/2012/BallotIssues/LR-120.pdf",
"comments": 5,
"support": 22,
...
}
],
"id": 26916,
"order": null,
"commentable": false,
"created_at": "2012-09-03T00:53:30Z",
"updated_at": "2012-09-10T18:54:38Z",
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment