--- a/taskapp/events/task.py Thu Feb 04 22:34:22 2010 +0530
+++ b/taskapp/events/task.py Thu Feb 04 22:37:15 2010 +0530
@@ -21,7 +21,7 @@
"""
try:
- task = Task.objects.get(title=title)
+ task = Task.objects.get(title__iexact=title)
return None
except Task.DoesNotExist:
task = Task(title=title)
@@ -32,3 +32,10 @@
task.save()
return task
+def addSubTask(main_task, sub_task):
+ """ add sub_task to subs list of main_task """
+
+ main_task.subs.add(sub_task)
+ main_task.status = "LO"
+ main_task.save()
+ return main_task