summaryrefslogtreecommitdiff
path: root/profile/models.py
blob: 827587602217393e0342743af5f8766078b4bf60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from django.db import models

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)