finalised the task model
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 20:49:12 +0530
changeset 320 285320d3063c
parent 319 70726699ca80
child 321 41af05ded3c6
finalised the task model
pytask/taskapp/models.py
--- a/pytask/taskapp/models.py	Sat Jan 08 20:25:05 2011 +0530
+++ b/pytask/taskapp/models.py	Sat Jan 08 20:49:12 2011 +0530
@@ -1,25 +1,37 @@
 from django.db import models
 
+STATUS_CHOICES = (
+        ("UP", "Unpublished"),
+        ("OP", "Open"),
+        ("LO", "Locked"),
+        ("WR", "Working"),
+        ("CD", "Closed"),
+        ("DL", "Deleted"),
+        ("CM", "Completed"))
+
 class Task(models.Model):
     
     uniq_key = models.CharField(max_length = 10, unique = True)
-    title = models.CharField(max_length = 100, verbose_name = u"Title", help_text = u"Keep it simple and below 100 chars.")
+    title = models.CharField(max_length = 100, verbose_name = u"Title", 
+                             help_text = u"Keep it simple and below 100 chars.")
     desc = models.TextField(verbose_name = u"Description")
 
     status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
-    tags_field = TagField(verbose_name = u"Tags", help_text = u"Give comma seperated tags") 
+    tags_field = TagField(verbose_name = u"Tags", 
+                          help_text = u"Give tags seperated by commas") 
     
-    pynts = models.PositiveSmallIntegerField(help_text = u"No.of pynts a user gets on completing the task")
-        
+    pynts = models.PositiveSmallIntegerField(help_text = u"No.of pynts a user \
+                                             gets on completing the task")
     created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
+    approved_by = models.ForeignKey(User, related_name = "%(class)s_approved_by")
+    reviewers = models.ManyToManyField(User, related_name = "%(class)s_reviewers")
 
-    claimed_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_claimed_users")
-    assigned_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_assigned_users")
-
-    reviewers = models.ManyToManyField(User, related_name = "%(class)s_reviewers")
+    claimed_users = models.ManyToManyField(User, blank = True, 
+                                           related_name = "%(class)s_claimed_users")
+    selected_users = models.ManyToManyField(User, blank = True, 
+                                            related_name = "%(class)s_selected_users")
     
     creation_datetime = models.DateTimeField()
-    sub_type = models.CharField(max_length=1, choices = (('D','Dependency'),('S','Subtask')), default = 'D')   
     
     def __unicode__(self):
         return unicode(self.title)