diff options
author | Primal Pappachan | 2012-02-21 17:13:58 +0530 |
---|---|---|
committer | Primal Pappachan | 2012-02-21 17:13:58 +0530 |
commit | 2ec613cf0d73553287a74a1536d39cc962b1ce0c (patch) | |
tree | 71734f8c3f1803d6421ce1d2e7cb99a7d5a3cebd /allotter | |
parent | 843478dc1cad9f50d110362a8e2016bb005d3a79 (diff) | |
download | aloha-2ec613cf0d73553287a74a1536d39cc962b1ce0c.tar.gz aloha-2ec613cf0d73553287a74a1536d39cc962b1ce0c.tar.bz2 aloha-2ec613cf0d73553287a74a1536d39cc962b1ce0c.zip |
added Profile to models and various choice dictionaries for examination, option and category
Diffstat (limited to 'allotter')
-rw-r--r-- | allotter/models.py | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/allotter/models.py b/allotter/models.py index ddb1b2d..ee5860f 100644 --- a/allotter/models.py +++ b/allotter/models.py @@ -1,11 +1,28 @@ from django.db import models - +from django.contrib.auth.models import User from datetime import datetime +EXAMINATION_SUBJECTS = ( + ("physics", "Physics"), + ("mathematics", "Mathematics"), + ("chemistry", "Chemistry"), + ) + +CATEGORIES = ( + ("GEN", "GENERAL"), + ("OBC", "OTHER BACKWARD CASTE"), + ) + +OPTIONS = ( + ("M.Sc Chem", "M.Sc Chemisty"), + ("M.Sc Phy", "M.Sc Physics"), + ("M.Sc Math","M.Sc Mathematics")) + class Option(models.Model): opt_name = models.CharField(max_length=100, verbose_name=u"Option name", - help_text=u"Name of Option/Stream") + help_text=u"Name of Option/Stream", + choices = OPTIONS) class Meta: verbose_name_plural = "Options" @@ -15,7 +32,8 @@ class Exam(models.Model): help_text=u"Unique code for the examination") exam_name = models.CharField(max_length=100, verbose_name=u"Examination name", - help_text=u"Subject name of the examination") + help_text=u"Subject name of the examination", + choices=EXAMINATION_SUBJECTS) option_available = models.ForeignKey("Option", default=1) @@ -23,12 +41,18 @@ class Exam(models.Model): return self.exam_name -class Student(models.Model): - name = models.CharField(max_length=1024, verbose_name=u"Name", +class Profile(models.Model): + user = models.OneToOneField(User) + name = models.CharField(max_length=1024, verbose_name=u"Full Name", help_text=u"Name given in the application") + roll_number = models.CharField(max_length=20, + verbose_name=u"Examination Roll number", + help_text=u"Roll number as per the Examination Hall ticket") dob = models.DateTimeField(verbose_name=u"Date of Birth", help_text=u"Date of birth as given in the application") - created = models.DateTimeField(auto_now_add=True) + category = models.CharField(max_length=30, choices=CATEGORIES) + email = models.CharField(max_length=50, verbose_name=u"Email id", + help_text=u"This will be for correspondence purposes") exam_taken = models.ForeignKey("Exam", default=1) |