Added utils to taskapp
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 23:47:06 +0530
changeset 343 94dd9d25d52a
parent 342 2e344786ce4f
child 344 aa61ea9c29f9
Added utils to taskapp
pytask/taskapp/utils.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pytask/taskapp/utils.py	Sat Jan 08 23:47:06 2011 +0530
@@ -0,0 +1,11 @@
+from pytask.taskapp.models import Task
+from django.http import Http404
+
+def getTask(tid):
+
+    try:
+        task = Task.objects.exclude(status="DL").get(uniq_key=tid)
+        return task
+    except Task.DoesNotExist:
+        raise Http404
+