added comment model
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 20:55:34 +0530
changeset 322 2120e853f10b
parent 321 41af05ded3c6
child 323 4ca185390379
added comment model
pytask/taskapp/models.py
--- a/pytask/taskapp/models.py	Sat Jan 08 20:49:35 2011 +0530
+++ b/pytask/taskapp/models.py	Sat Jan 08 20:55:34 2011 +0530
@@ -35,3 +35,18 @@
     
     def __unicode__(self):
         return unicode(self.title)
+
+class TaskComment(models.Model):
+
+    uniq_key = models.CharField(max_length = 10, unique = True)
+    task = models.ForeignKey('Task', related_name = "%(class)s_task")
+            
+    data = models.TextField()
+    created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
+    deleted_by = models.ForeignKey(User, null = True, blank = True,
+                                   related_name = "%(class)s_deleted_by")
+    creation_datetime = models.DateTimeField()
+    is_deleted = models.BooleanField(default=False)
+
+    def __unicode__(self):
+        return unicode(self.task.title)