def log_query(q): """Log Query :param q: Query """ statement = q.statement.compile(dialect=sqlite.dialect()) if statement.params: query_str = '{0}\n{1}'.format(statement, statement.params) else: query_str = str(statement) log.debug(query_str)
def ballot_box(): """Get Ballot Box Page""" log.debug("Render Page: ballot-box") form = BallotBoxForm(request, settings.BALLOT_BOX_FILTERS) contests = db.get_all_contests() if request.method == 'GET': voter_id = request.args.get('voter-id') if voter_id: form.search = voter_id form.contests = form.get_filtered_contests(contests) form.contest_groups = form.get_contest_groups() form.set_form_contest() form.set_contest_groups_expanded(request) return render_template('ballot-box.html', title='Ballot Box', form=form)
def home(): """Get Home Page""" log.debug("Render Page: Home") return redirect('/ballot-box') return render_template('index.html', title='Home Page', )