Candidate Model

class elections.models.Candidate

A candidate running in an election

test_live

Required CharField(1)

Single character flag indicating test (t) vs. live (l) election results data.

politician_id

IntegerField Primary Key

National Politician ID(NPID). Uniquely assigned ID for this politician, regardless of the state or races in which this politician is a candidate.

Field may be empty if no unique ID has been assigned to this politician.

ap_candidate_id

Required IntegerField Unique

AP-assigned unique ID identifying this specific candidate.

candidate_number

Required IntegerField

AP defined candidate number. Candidate numbers are guaranteed unique only within a single state. See Candidate.politician_id field below for the unique candidate number/ID at the National level, if available.

first_name

CharField(64)

Candidate’s first name.

middle_name

CharField(64)

Candidate’s middle name.

last_name

CharField(64)

Candidate’s last name.

junior

CharField(16)

Trailing Jr or Sr, etc.

use_junior

Required BooleanField default: False

Flag indicating whether The AP appends the junior suffix to the candidate’s name in reports.

year_first_elected

IntegerField

The year the candidate was first elected to their current office.

birth_date

DateField

The candidate’s birth date

birth_place

CharField(100)

The name of the place of the candidate’s birth.

birth_state

CharField(2)

The two-letter state abbreviation of the state in which the candidate was born (If in the United States).

birth_province

CharField(100)

The name of the province in which the candidate was born (If outside the United States).

birth_country

CharField(100)

The name of the country in which the candidate was born.

residence_place

CharField(100)

The name of the place in which the candidate currently lives.

residence_state

CharField(2)

The two-letter state abbreviation in which the candidate currently resides.

gender

CharField(1)

Either M for male, or F for female.

ethnicity

CharField(100)

The candidate’s ethnicity

hispanic

CharField(100)

The candidate’s hispanic background

religion

CharField(100)

The candidate’s declared practiced religion.

biography

TextField

A simple biographical narrative of the candidate.

profile

TextField

A political profile of the candidate.

campaigns

TextField

Brief information about current election campaigns.

timestamp

Required DateTime

When the information was last modified.

Properties

Candidate.full_name

The candidate’s full name, formatted correctly depending on the existence of a middle name and junior suffix.

Table Of Contents

Previous topic

CountyResult Model

Next topic

RaceDistrict Model