created work report model and reportcomment model
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 21:08:18 +0530
changeset 86 2f20098f2da3
parent 85 4ca185390379
child 87 8f8bd185aacf
created work report model and reportcomment model
pytask/taskapp/models.py
--- a/pytask/taskapp/models.py	Sat Jan 08 20:58:17 2011 +0530
+++ b/pytask/taskapp/models.py	Sat Jan 08 21:08:18 2011 +0530
@@ -65,3 +65,30 @@
     def __unicode__(self):
         return unicode(self.task.title)
 
+class WorkReport(models.Model):
+
+    task = models.ForeignKey(Task, related_name = "%(class)s_task")
+    submitted_by = models.ForeignKey(User, 
+                                     related_name = "%(class)s_submitted_by")
+    approved_by = models.ForeignKey(User, 
+                                    related_name = "%(class)s_approved_by")
+
+    data = models.TextField()
+    summary = models.CharField(max_length=100, verbose_name="Summary",
+                               help_text="A one line summary")
+    attachment = models.FileField(upload_to = UPLOADS_DIR)
+
+    revision = models.PositiveIntegerField(default=0)
+    submitted_at = models.DateTimeField()
+
+class ReportComment(models.Model):
+
+    uniq_key = models.CharField(max_length = 10, unique = True)
+    report = models.ForeignKey('WorkReport', related_name = "%(class)s_report")
+            
+    data = models.TextField()
+    commented_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")
+    comment_datetime = models.DateTimeField()
+    is_deleted = models.BooleanField(default=False)