A task should be able to have sub tasks. So sub tasks are linked to their parents.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Sun, 30 Jan 2011 20:03:48 +0530
changeset 527 c894de293216
parent 526 9c0c88d129dd
child 528 56474add44b1
A task should be able to have sub tasks. So sub tasks are linked to their parents.
pytask/taskapp/models.py
--- a/pytask/taskapp/models.py	Sun Jan 30 18:59:23 2011 +0530
+++ b/pytask/taskapp/models.py	Sun Jan 30 20:03:48 2011 +0530
@@ -27,6 +27,9 @@
 
 class Task(models.Model):
 
+    parent = models.ForeignKey('self', blank=True, null=True,
+                               related_name="children_tasks")
+
     title = models.CharField(
       max_length=1024, verbose_name=u"Title",
       help_text=u"Keep it simple and below 100 chars.")