summaryrefslogtreecommitdiff
path: root/profile
diff options
context:
space:
mode:
authorNishanth Amuluru2011-01-06 16:48:29 +0530
committerNishanth Amuluru2011-01-06 16:48:29 +0530
commit97f6aec3af6dfb87dc3f409b901e5ebc0dfc0fb3 (patch)
treee538f0655a0c606458e6248eb3a164ecca6fd600 /profile
parentd14f22b78799a7fdd561848533a495ea5640366c (diff)
downloadpytask-97f6aec3af6dfb87dc3f409b901e5ebc0dfc0fb3.tar.gz
pytask-97f6aec3af6dfb87dc3f409b901e5ebc0dfc0fb3.tar.bz2
pytask-97f6aec3af6dfb87dc3f409b901e5ebc0dfc0fb3.zip
Added the model for holding user info
Diffstat (limited to 'profile')
-rwxr-xr-xprofile/models.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/profile/models.py b/profile/models.py
index 71a8362..8275876 100755
--- a/profile/models.py
+++ b/profile/models.py
@@ -1,3 +1,29 @@
from django.db import models
-# Create your models here.
+from django.contrib.auth.models import User
+
+GENDER_CHOICES = (( 'M', 'Male'), ('F', 'Female'))
+
+RIGHTS_CHOICES = (
+ ("DC", "Director"),
+ ("MG", "Manager"),
+ ("CT", "Contributor"),)
+
+class Profile(models.Model):
+
+ user = models.ForeignKey(User, unique = True)
+ rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES, default = u"CT")
+ pynts = models.PositiveSmallIntegerField(default = 0)
+
+ aboutme = models.TextField(blank = True, help_text="This information will\
+ be used to judge the eligibility for any task")
+
+ dob = models.DateField(verbose_name = u"Date of Birth", help_text = "YYYY-MM-DD")
+ gender = models.CharField(max_length = 1, choices = GENDER_CHOICES)
+
+ address = models.TextField(blank = False, help_text="This information will\
+ be used to send any DDs/Cheques")
+ phonenum = models.CharField(max_length = 15, blank = True, verbose_name = u"Phone Number")
+
+ def __unicode__(self):
+ return unicode(self.user.username)