taskapp/models.py
changeset 38 7910ff503036
parent 33 0d0ea7b188d5
child 48 8670846be981
equal deleted inserted replaced
37:40651a873f44 38:7910ff503036
    23 UPLOADS_DIR = "./uploads"
    23 UPLOADS_DIR = "./uploads"
    24 
    24 
    25 class Profile(models.Model):
    25 class Profile(models.Model):
    26 	
    26 	
    27     user = models.ForeignKey(User, unique = True)
    27     user = models.ForeignKey(User, unique = True)
    28     dob = models.DateField(help_text = "YYYY-MM-DD")
    28     dob = models.DateField(verbose_name = u"Date of Birth", help_text = "YYYY-MM-DD")
    29     gender = models.CharField(max_length = 1, choices = GENDER_CHOICES)
    29     gender = models.CharField(max_length = 1, choices = GENDER_CHOICES)
    30     rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES, default = u"CT")
    30     rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES, default = u"CT")
    31     credits = models.PositiveSmallIntegerField(default = 0)
    31     credits = models.PositiveSmallIntegerField(default = 0)
    32     
    32     
    33     aboutme = models.TextField(blank = True)
    33     aboutme = models.TextField(blank = True)
    34     foss_comm = models.CharField(max_length = 80, blank = True)
    34     foss_comm = models.CharField(max_length = 80, blank = True, verbose_name = u"Foss Communities", help_text = u"Comma seperated list of foss communities you are involved in.")
    35     phonenum = models.CharField(max_length = 15, blank = True)
    35     phonenum = models.CharField(max_length = 15, blank = True, verbose_name = u"Phone Number")
    36     homepage = models.URLField(blank = True)
    36     homepage = models.URLField(blank = True, verbose_name = u"Homepage/Blog")
    37     street = models.CharField(max_length = 80, blank = True)
    37     street = models.CharField(max_length = 80, blank = True)
    38     city = models.CharField(max_length = 25, blank = True)
    38     city = models.CharField(max_length = 25, blank = True)
    39     country = models.CharField(max_length = 25, blank = True)
    39     country = models.CharField(max_length = 25, blank = True)
    40     nick = models.CharField(max_length = 20, blank = True)
    40     nick = models.CharField(max_length = 20, blank = True)
    41 #    photo = models.ImageField(upload_to = IMAGES_DIR, blank = True)
    41 #    photo = models.ImageField(upload_to = IMAGES_DIR, blank = True)
    44         return unicode(self.user.username)
    44         return unicode(self.user.username)
    45 
    45 
    46 
    46 
    47 class Task(models.Model):
    47 class Task(models.Model):
    48     
    48     
    49     title = models.CharField(max_length = 100, unique = True)
    49     title = models.CharField(max_length = 100, unique = True, verbose_name = u"Title", help_text = u"Keep it simple and below 100 chars.")
    50     desc = models.TextField()
    50     desc = models.TextField(verbose_name = u"Description")
    51     status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
    51     status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
    52     tags = models.CharField(max_length = 200, blank = True)
    52     tags = models.CharField(max_length = 200, blank = True)
    53     
    53     
    54     subs = models.ManyToManyField('self', blank = True, related_name = "%(class)s_parents")
    54     subs = models.ManyToManyField('self', blank = True, related_name = "%(class)s_parents")
    55     deps = models.ManyToManyField('self', blank = True, related_name = "%(class)s_deps")
    55     deps = models.ManyToManyField('self', blank = True, related_name = "%(class)s_deps")