def results_list(): ''' Displays the results of all published election. ''' elections = nuancierlib.get_elections_public(SESSION) return flask.render_template( 'result_list.html', elections=elections)
def test_get_elections_public(self): """ Test the get_elections_public function. """ create_elections(self.session) elections = nuancierlib.get_elections_public(self.session) self.assertEqual(1, len(elections)) self.assertEqual('Wallpaper F19', elections[0].election_name)
def index(): ''' Display the index page. ''' elections = nuancierlib.get_elections_open(SESSION) contributions = nuancierlib.get_elections_to_contribute(SESSION) published = nuancierlib.get_elections_public(SESSION) election = election_results = None if published: election = published[0] election_results = nuancierlib.get_results(SESSION, election.id) return flask.render_template('index.html', elections=elections, election=election, results=election_results, contributions=contributions)
def index(): ''' Display the index page. ''' elections = nuancierlib.get_elections_open(SESSION) contributions = nuancierlib.get_elections_to_contribute(SESSION) published = nuancierlib.get_elections_public(SESSION) election = election_results = None if published: election = published[0] election_results = nuancierlib.get_results(SESSION, election.id) return flask.render_template( 'index.html', elections=elections, election=election, results=election_results, contributions=contributions)
def results_list(): ''' Displays the results of all published election. ''' elections = nuancierlib.get_elections_public(SESSION) return flask.render_template('result_list.html', elections=elections)