Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <form action="" method="get">
  2. <a class="btn btn-success">START</a>
  3. </form>
  4.  
  5. url(r'^start/$', survey_views.start),
  6.  
  7. url(r'^surveyone/$', SurveyWizardOne.as_view([SurveyFormA, SurveyFormB, SurveyFormC, SurveyFormD ])),
  8. url(r'^surveytwo/$', SurveyWizardTwo.as_view([SurveyFormA, SurveyFormB, SurveyFormC, SurveyFormD ])),
  9. url(r'^surveythree/$', SurveyWizardThree.as_view([SurveyFormA, SurveyFormB, SurveyFormC, SurveyFormD ])),
  10.  
  11. def start(request):
  12. return render(request, 'start.html')
  13.  
  14. class SurveyWizardOne(SessionWizardView):
  15. def done(self, form_list, **kwargs):
  16. return render_to_response('Return_to_AMT.html', {
  17. 'form_data': [form.cleaned_data for form in form_list],
  18. })
  19.  
  20. class SurveyWizardTwo(SessionWizardView):
  21. def done(self, form_list, **kwargs):
  22. return render_to_response('Return_to_AMT.html', {
  23. 'form_data': [form.cleaned_data for form in form_list],
  24. })
  25.  
  26. class SurveyWizardThree(SessionWizardView):
  27. def done(self, form_list, **kwargs):
  28. return render_to_response('Return_to_AMT.html', {
  29. 'form_data': [form.cleaned_data for form in form_list],
  30. })
  31.  
  32. def start(request):
  33. survey_urls = ['/surveyone/', '/surveytwo/', '/surveythree/']
  34. survey_url = random.choice(surveys)
  35. return render(request, 'start.html', {'survey_url': survey_url})
  36.  
  37. <a class="btn btn-success" href="{{survey_url}}">START</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement