# HG changeset patch # User Nishanth Amuluru # Date 1294312709 -19800 # Node ID 93bee6c96c353e4bf20d6deb7f2e23a90c3b129d # Parent 479cbf5c822a388f24eb672c5e07a9254d20131f Added the model for holding user info diff -r 479cbf5c822a -r 93bee6c96c35 profile/models.py --- a/profile/models.py Thu Jan 06 16:41:53 2011 +0530 +++ b/profile/models.py Thu Jan 06 16:48:29 2011 +0530 @@ -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)