taskapp/views/user.py
changeset 168 42aba20cfe97
parent 167 b61e45074ba1
child 169 229bed827965
--- a/taskapp/views/user.py	Tue Mar 02 03:21:20 2010 +0530
+++ b/taskapp/views/user.py	Tue Mar 02 03:55:38 2010 +0530
@@ -46,7 +46,7 @@
     if not user.is_authenticated():
         is_guest = True
         disp_num = 10
-        task_list = Task.objects.exclude(status="UP").order_by('published_datetime').reverse()[:10]
+        task_list = Task.objects.exclude(status="UP").exclude(status="CD").exclude("CM").order_by('published_datetime').reverse()[:10]
         return render_to_response('index.html', {'user':user, 'is_guest':is_guest, 'task_list':task_list})
         
     else:
@@ -63,6 +63,9 @@
                    }
 
         context["unpublished_tasks"] = user.task_mentors.filter(status="UP")
+        context["mentored_tasks"] = user.task_mentors.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL")
+        context["claimed_tasks"] = user.task_claimed_users.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL")
+        context["working_tasks"] = user.task_assigned_users.filter(status="WR")
                    
         return render_to_response('index.html', context)