taskapp/views/task.py
changeset 215 84ec0ca5bc68
parent 205 0c317f68df49
child 217 307f699e6102
--- a/taskapp/views/task.py	Tue Mar 09 11:39:34 2010 +0530
+++ b/taskapp/views/task.py	Wed Jan 05 18:48:14 2011 +0530
@@ -24,6 +24,19 @@
                }
     return render_to_response('task/browse.html', context)
 
+def show_textbooks(request):
+    """ display all the tasks """
+    
+    user = get_user(request.user) if request.user.is_authenticated() else request.user
+    task_list = Task.objects.exclude(status="UP").exclude(status="DL").order_by('published_datetime').reverse()
+
+    textbooks = task_list.filter(tags_field__icontains="textbook")
+    
+    context = {'user':user,
+               'task_list':task_list,
+               }
+    return render_to_response('task/browse.html', context)
+
 def publish_task(request, tid):
     """ check if user is the mentor and also if the task status is UP.
     """