diff options
author | Madhusudan.C.S | 2011-01-14 00:59:09 +0530 |
---|---|---|
committer | Madhusudan.C.S | 2011-01-14 00:59:09 +0530 |
commit | bb35c0a7546440247dad47f57d748259d0e9a744 (patch) | |
tree | 76f740c37954d23da88fcd2af856f74a5bc1e9e5 /taskapp/utilities/task.py | |
parent | 8b708b1b475caad85e12022db6d3d9af3387fbfe (diff) | |
download | pytask-bb35c0a7546440247dad47f57d748259d0e9a744.tar.gz pytask-bb35c0a7546440247dad47f57d748259d0e9a744.tar.bz2 pytask-bb35c0a7546440247dad47f57d748259d0e9a744.zip |
Purging the repository for the new set of changes by Nishanth.
Diffstat (limited to 'taskapp/utilities/task.py')
-rw-r--r-- | taskapp/utilities/task.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/taskapp/utilities/task.py b/taskapp/utilities/task.py deleted file mode 100644 index 3a7ebdf..0000000 --- a/taskapp/utilities/task.py +++ /dev/null @@ -1,37 +0,0 @@ -from django.http import Http404 -from pytask.taskapp.models import Task, Map - -def getTask(tid): - """ retreive the task from database. - if the task has deps or subs, update its status correspondingly. - """ - - try: - task = Task.objects.get(id=tid) - except Task.DoesNotExist: - raise Http404 - try: - mapobj = Map.objects.get(main=task) - except Map.DoesNotExist: - mapobj = Map() - mapobj.main = task - mapobj.save() - - task_subs = mapobj.subs.all() - - if task.sub_type == "D": - task.deps, task.subs = task_subs, [] - elif task.sub_type == "S": - task.subs, task.deps = task_subs, [] - - deps, subs = task.deps, task.subs - if deps and task.status in ["OP", "LO"]: - task.status = "OP" if all(map(lambda t:t.status=="CM",deps)) else "LO" - - ## a task with subs will remain in "LO" and will be made "OP" only if all subs are removed. - if subs and task.status in ["OP", "LO"]: - task.status = "LO" - - task.save() - return task - |