def _redirect_for_next_question(self, survey_id, question_id): try: next_question = self._next_question(survey_id, question_id) except IndexError: return self._goodbye_message() url_parameters = parameters_for_survey_url(next_question.survey_id, next_question.id) next_question_url = reverse("question", kwargs=url_parameters) see_other = redirect(next_question_url) see_other.status_code = 303 see_other.reason_phrase = "See Other" return see_other
def show_question(request, survey_id, question_id): question = Question.objects.get(id=question_id) url_parameters = parameters_for_survey_url(question.survey.id, question.id) question_store_url = reverse('record_response', kwargs=url_parameters) voice_response = twiml.Response() voice_response.say(question.body) voice_response.say(instructions[question.kind]) voice_response = _attach_command_to_response( voice_response, question.kind, question_store_url ) return HttpResponse(voice_response, content_type='application/xml')