Exemple #1
0
    def do_menu(self):
        t = Tropo()
        prompt = """
        You will shortly be prompted to enter the two digit code for the
        company you want to vote for.  If you already know the code, you can
        enter it at any time using your phone's keypad.
        """
        for candidate in models.get_candidates():
            prompt += "For %s, enter %s. " % (candidate['name'], candidate['vote_code'])

        t.ask(Choices("[2 DIGITS]", mode="dtmf"), say=prompt)
        t.on(event="continue", next=self.response_url())
        return t.RenderJson()
Exemple #2
0
 def GET(self):
     candidates = models.get_candidates()
     return render.index(candidates)