taskapp/models.py
changeset 18 a39549bd5b08
parent 12 a93eebabfeb1
child 21 c28774fe7ffd
equal deleted inserted replaced
17:aa45fec40e7e 18:a39549bd5b08
     7 	("MN", "Manager"),
     7 	("MN", "Manager"),
     8 	("DV", "Developer"),
     8 	("DV", "Developer"),
     9 	("CT", "Contributor"),)
     9 	("CT", "Contributor"),)
    10 
    10 
    11 STATUS_CHOICES = (
    11 STATUS_CHOICES = (
       
    12     ("UP", "Unpublished"),
    12 	("OP", "Open"),
    13 	("OP", "Open"),
    13     ("LO", "Locked"),
    14     ("LO", "Locked"),
    14 	("CL", "Claimed"),
    15 	("CL", "Claimed"),
    15 	("AS", "Assigned"),
    16 	("AS", "Assigned"),
    16     ("RO", "Reopened"),
    17     ("RO", "Reopened"),
    45 
    46 
    46 class Task(models.Model):
    47 class Task(models.Model):
    47     
    48     
    48     title = models.CharField(max_length = 200, unique = True)
    49     title = models.CharField(max_length = 200, unique = True)
    49     desc = models.TextField()
    50     desc = models.TextField()
    50     status = models.CharField(max_length = 2, choices = STATUS_CHOICES)
    51     status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
    51     tags = models.CharField(max_length = 200, blank = True)
    52     tags = models.CharField(max_length = 200, blank = True)
    52     
    53     
    53     subs = models.ManyToManyField('self', blank = True, related_name = "%(class)s_parents")
    54     subs = models.ManyToManyField('self', blank = True, related_name = "%(class)s_parents")
    54     deps = models.ManyToManyField('self', blank = True, related_name = "%(class)s_deps")
    55     deps = models.ManyToManyField('self', blank = True, related_name = "%(class)s_deps")
    55     
    56     
    56     credits = models.PositiveSmallIntegerField()
    57     credits = models.PositiveSmallIntegerField()
    57     progress = models.PositiveSmallIntegerField()
    58     progress = models.PositiveSmallIntegerField(default = 0)
    58         
    59         
    59     mentors = models.ManyToManyField(User, related_name = "%(class)s_mentors")
    60     mentors = models.ManyToManyField(User, related_name = "%(class)s_mentors")
    60     created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
    61     created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
    61     claimed_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_claimed_users")
    62     claimed_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_claimed_users")
    62     assigned_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_assigned_users")
    63     assigned_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_assigned_users")