From c78804ce5141565ee0e2a64e7f92aaaa126f30e0 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Mon, 19 Mar 2012 16:23:59 +0530 Subject: working version of the options submission form and saving onto the database --- allotter/urls.py | 2 +- allotter/views.py | 3 ++- template/allotter/apply.html | 5 ++--- template/base.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/allotter/urls.py b/allotter/urls.py index 611fb88..aa0d62d 100644 --- a/allotter/urls.py +++ b/allotter/urls.py @@ -5,7 +5,7 @@ urlpatterns = patterns('allotter.views', url(r'^logout/$', 'user_logout'), url(r'^apply/$', 'apply'), url(r'^(?P\w+)/submit/$', 'submit'), #change into numbers - url(r'^(?P\w+)/complete/$', 'complete'), #change into numbers + url(r'^(?P\d+)/complete/$', 'complete'), #change into numbers url(r'^$', 'apply'), #url(r'^quit/$', 'quit'), ) diff --git a/allotter/views.py b/allotter/views.py index d4f1a0a..743c373 100644 --- a/allotter/views.py +++ b/allotter/views.py @@ -4,6 +4,7 @@ from django.shortcuts import render_to_response, get_object_or_404 from django.shortcuts import render, redirect from django.template import RequestContext from django.http import Http404 + #TODO: Remove this if possible from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse @@ -123,7 +124,7 @@ def submit(request, reg_no): user_application.options_selected += options_list user_application.save() return HttpResponseRedirect(reverse('allotter.views.complete', args=(reg_no,))) - return redirect('/allotter/complete/') + #return redirect('/allotter/complete/') #User Application diff --git a/template/allotter/apply.html b/template/allotter/apply.html index c38837a..e1c728d 100644 --- a/template/allotter/apply.html +++ b/template/allotter/apply.html @@ -56,20 +56,19 @@ Listing the options for first test paper. Listing the options for second test paper if it exists. {% endcomment %} -{% comment %} + {% if np == 2 %} {% for option in options_available_second %}

{{ option.opt_name }}

{% for i in oafl|get_range %} - {{i}}
+
{% endfor %} None
{% endfor %} {% endif %} -{% endcomment %} diff --git a/template/base.html b/template/base.html index d10402c..cd937ba 100644 --- a/template/base.html +++ b/template/base.html @@ -7,7 +7,7 @@ border: 2px solid red; } - {% block title %}Tagging Exploration{% endblock %} + {% block title %} {% endblock %} -- cgit