profile/models.py
changeset 242 93bee6c96c35
parent 241 479cbf5c822a
child 243 4c3aff34ae9c
equal deleted inserted replaced
241:479cbf5c822a 242:93bee6c96c35
     1 from django.db import models
     1 from django.db import models
     2 
     2 
     3 # Create your models here.
     3 from django.contrib.auth.models import User
       
     4 
       
     5 GENDER_CHOICES = (( 'M', 'Male'), ('F', 'Female'))
       
     6 
       
     7 RIGHTS_CHOICES = (
       
     8 	("DC", "Director"),
       
     9 	("MG", "Manager"),
       
    10 	("CT", "Contributor"),)
       
    11 
       
    12 class Profile(models.Model):
       
    13     
       
    14     user = models.ForeignKey(User, unique = True)
       
    15     rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES, default = u"CT")
       
    16     pynts = models.PositiveSmallIntegerField(default = 0)
       
    17     
       
    18     aboutme = models.TextField(blank = True, help_text="This information will\
       
    19                                be used to judge the eligibility for any task")
       
    20 
       
    21     dob = models.DateField(verbose_name = u"Date of Birth", help_text = "YYYY-MM-DD")
       
    22     gender = models.CharField(max_length = 1, choices = GENDER_CHOICES)
       
    23 
       
    24     address = models.TextField(blank = False, help_text="This information will\
       
    25                                be used to send any DDs/Cheques")
       
    26     phonenum = models.CharField(max_length = 15, blank = True, verbose_name = u"Phone Number")
       
    27 
       
    28     def __unicode__(self):
       
    29         return unicode(self.user.username)