summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrimal Pappachan2012-03-16 15:54:37 +0530
committerPrimal Pappachan2012-03-16 15:54:37 +0530
commit8c88a95c5e12662c31f3740eb4006dc83444e65d (patch)
treecbddbe433da14eeeade1a03c2c5aa2790e7e3a5f
parentbad8e4d23b4c3ea19bcb3b295a8c16363f49919b (diff)
downloadaloha-8c88a95c5e12662c31f3740eb4006dc83444e65d.tar.gz
aloha-8c88a95c5e12662c31f3740eb4006dc83444e65d.tar.bz2
aloha-8c88a95c5e12662c31f3740eb4006dc83444e65d.zip
Changed the foreign key relationship between Profile and Application
-rw-r--r--allotter/models.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/allotter/models.py b/allotter/models.py
index f238841..fc0353c 100644
--- a/allotter/models.py
+++ b/allotter/models.py
@@ -74,25 +74,11 @@ class Option(models.Model):
return self.opt_name
-class Profile(models.Model):
-
- user = models.OneToOneField(User)
-
- #Used for verification purposes
- dob = models.DateField(verbose_name=u"Date of Birth",
- help_text=u"Date of birth as given in the application")
-
- def __unicode__(self):
- u = self.user
- return u'User Profile {0} {1}'.format(u.first_name, u.last_name)
-
class Application(models.Model):
"""An application for the student - one per student
"""
- user = models.ForeignKey(User)
-
- profile = models.ForeignKey(Profile)
-
+ user = models.OneToOneField(User)
+
##To be filled by applicant
options_selected = models.CharField(max_length=5000,help_text="CSV formatted list of options", blank=True)
@@ -119,3 +105,20 @@ class Application(models.Model):
u = self.user
return u'Application for {0} {1}'.format(u.first_name, u.last_name)
+class Profile(models.Model):
+
+ user = models.OneToOneField(User)
+
+ #Used for verification purposes
+ dob = models.DateField(verbose_name=u"Date of Birth",
+ help_text=u"Date of birth as given in the application")
+
+ #Application for the Profile
+ application = models.ForeignKey(Application)
+
+ def __unicode__(self):
+ u = self.user
+ return u'User Profile {0} {1}'.format(u.first_name, u.last_name)
+
+
+