Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Goodbye Candidate. For #98.
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Jan 26, 2016
1 parent 2ba880a commit 80d5854
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions elections/ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,57 +715,6 @@ def __init__(self, client, name='20141104', results=True, delegates=False):



class Candidate(object):
"""
A choice for voters in a race.
In the presidential race, a person, like Barack Obama.
In a ballot measure, a direction, like Yes or No.
"""
def __init__(
self, first_name=None, middle_name=None, last_name=None,
abbrev_name=None, suffix=None, use_suffix=False,
ap_natl_number=None, ap_polra_number=None,
ap_race_number=None,
party=None, ap_pol_number=None, is_winner=None,
is_runoff=None, delegates=None, is_incumbent=None,
vote_total=None
):
self.first_name = first_name
self.middle_name = middle_name
self.last_name = last_name
self.abbrev_name = abbrev_name
self.suffix = suffix
self.use_suffix = use_suffix
self.ap_natl_number = ap_natl_number
self.ap_polra_number = ap_polra_number
self.ap_race_number = ap_race_number
self.ap_pol_number = ap_pol_number
self.party = party
self.is_winner = is_winner
self.is_runoff = is_runoff
self.delegates = delegates
self.is_incumbent = is_incumbent
self.vote_total = vote_total

def __unicode__(self):
return unicode(self.name)

def __str__(self):
return self.__unicode__().encode("utf-8")

def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self.__unicode__())

@property
def name(self):
if self.last_name not in ('Yes', 'No'):
s = " ".join([i for i in [self.first_name, self.last_name] if i])
return s.strip()
else:
return u'%s' % self.last_name


class Result(object):
"""
The vote count for a candidate in a race in a particular reporting unit.
Expand Down

0 comments on commit 80d5854

Please sign in to comment.