From a9b1f51e9766e45438be2ea97a3e75e8997a5373 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Wed, 11 Apr 2012 12:38:41 +0530 Subject: Added category and pd field --- aloha/allotter/forms.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py index cd79b0e..480d8b9 100644 --- a/aloha/allotter/forms.py +++ b/aloha/allotter/forms.py @@ -1,6 +1,7 @@ from django import forms from allotter.models import Profile from django.forms.extras.widgets import SelectDateWidget +from django.forms.widgets import RadioSelect from django.utils.encoding import * @@ -13,6 +14,9 @@ from string import digits, uppercase BIRTH_YEAR_CHOICES = tuple(range(1960, 1994, 1)) DD_YEAR_CHOICES = (2012,) +CATEGORY_CHOICES = [('GEN','General'), ('OBC-NM', 'OBC-Non-Minority'), ('OBC-M', 'OBC-Minority'), + ('SC', 'SC'), ('ST', 'ST')] +PD_CHOICES = [('Y', 'Yes'), ('N', 'No')] class UserLoginForm(forms.Form): @@ -131,9 +135,18 @@ class UserDetailsForm(forms.Form): email = forms.EmailField(label="Email Address", widget=forms.TextInput(attrs={"placeholder":"john@example.com",}), help_text="Enter a valid email id where you will able to receive correspondence from JAM 2012.") - phone_number = forms.CharField(label="Phone number", max_length=15, widget=forms.TextInput(attrs={"placeholder":"9876543210",}), help_text="Phone number with code. For example 02225722545 (with neither spaces nor dashes)") - cat_check = forms.BooleanField(required=False, initial=False, label="Check this if you belong to SEBC-M Category") + phone_number = forms.CharField(label="Phone number", max_length=15, + widget=forms.TextInput(attrs={"placeholder":"9876543210",}), + help_text="Phone number with code. For example 02225722545 (with neither spaces nor dashes)") + + category = forms.ChoiceField(widget=forms.Select(attrs={'class':'selector'}), + label="Category", choices=CATEGORY_CHOICES, + help_text="Category under which you would be considered for admission.") + + pd = forms.ChoiceField(label="Physical Disability", widget=RadioSelect, choices=PD_CHOICES) + + def clean_phone_number(self): pno = self.cleaned_data['phone_number'] @@ -147,15 +160,16 @@ class UserDetailsForm(forms.Form): email = self.cleaned_data['email'] phone_number = self.cleaned_data['phone_number'] - cat_check = self.cleaned_data['cat_check'] + category = self.cleaned_data['category'] if email and phone_number: user_profile.secondary_email = email - user_profile.phone_number = phone_number + user_profile.phone_number = phone_number else: raise forms.ValidationError("Make sure that you have entered all the details.") - if cat_check: - user_profile.cat_status = True - + + user_application = user_profile.application + user_application.cgy = category + user_application.save() user_profile.save() -- cgit From 9adec90902f59a41b418b19975cfbad2db90f354 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Wed, 11 Apr 2012 12:39:15 +0530 Subject: added field for pd status, removed cat flag --- aloha/allotter/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aloha/allotter/models.py b/aloha/allotter/models.py index 3be370f..4d3ac3e 100644 --- a/aloha/allotter/models.py +++ b/aloha/allotter/models.py @@ -102,7 +102,9 @@ class Application(models.Model): cent = models.IntegerField(max_length=10, verbose_name="Center Code") cgy = models.CharField(max_length=10, verbose_name="Category") - + + pd_status = models.CharField(max_length=1, verbose_name="Physical Disability", + help_text="Y for Yes, N for No", blank=True, default="N") submitted = models.BooleanField(verbose_name="Submission Status", default=False) @@ -125,9 +127,7 @@ class Profile(models.Model): help_text=u"Phone number read from user after authentication") dd_no = models.CharField(max_length=15, verbose_name="Demand Draft Number", blank=True, null=True) - - cat_status = models.BooleanField(help_text="Whether belongs to Category SBOBC", default=False) - + #Application for the Profile application = models.ForeignKey(Application) -- cgit From 31afa442edf5edcd880f67367b91ef32ed6cf89b Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Wed, 11 Apr 2012 12:52:56 +0530 Subject: Removed cat_flag check --- aloha/allotter/views.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/aloha/allotter/views.py b/aloha/allotter/views.py index a91b5e5..344669f 100644 --- a/aloha/allotter/views.py +++ b/aloha/allotter/views.py @@ -61,10 +61,7 @@ def submit_details(request): Get the secondary email address, phone number and save it to the Profile. """ user = request.user - category = user.get_profile().application.cgy #Getting the Category information - #Flag set based on OBC Check - if category == "B": cat_flag = True - else: cat_flag = False + if request.method == "POST": form = UserDetailsForm(user, request.POST) if form.is_valid(): @@ -76,7 +73,7 @@ def submit_details(request): else: form = UserDetailsForm(request.user) - context = {"form": form, "cat_flag": cat_flag} + context = {"form": form} return render(request, 'allotter/details.html', context) def get_details(user, error_message = ""): -- cgit From e3dc4ad8dbd0d86159f8b2404c2ee3eb7b76c76c Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Wed, 11 Apr 2012 12:53:51 +0530 Subject: removed category check --- aloha/template/allotter/details.html | 9 --------- 1 file changed, 9 deletions(-) diff --git a/aloha/template/allotter/details.html b/aloha/template/allotter/details.html index 4cfe1a2..bedcf90 100644 --- a/aloha/template/allotter/details.html +++ b/aloha/template/allotter/details.html @@ -1,15 +1,6 @@ {% extends "base.html" %} {% block title %}Details form {% endblock %} -{% block scripts %} - -{% endblock scripts %} {% block content %}
Please note: The order of Preference plays an important role in the admission process.
@@ -92,6 +94,13 @@ under both the papers, the order of preferences should be combined. For example: qualifying both BT and CY can have an order of preference such as 1 under BT, 2 under CY, 3 under BT and so on.
+ ++Candidates should ensure that the choices specified by them +are distinct for each programme of their interest and are in the +ascending order of their preference - i.e. their most preferred +programme is selected as 1, etc. +
diff --git a/aloha/template/allotter/complete.html b/aloha/template/allotter/complete.html index 19aa102..cc8e4e5 100644 --- a/aloha/template/allotter/complete.html +++ b/aloha/template/allotter/complete.html @@ -17,9 +17,10 @@ $(document).ready(function(){ {% block content %} -