# HG changeset patch # User Nishanth Amuluru # Date 1294233494 -19800 # Node ID 84ec0ca5bc6876dbc9e7f563d877bccd6b0505e7 # Parent 679c7e2370522d14ff5a6e070ed757d09af816c5 Added a page for displaying all the textbooks diff -r 679c7e237052 -r 84ec0ca5bc68 taskapp/models.py --- a/taskapp/models.py Tue Mar 09 11:39:34 2010 +0530 +++ b/taskapp/models.py Wed Jan 05 18:48:14 2011 +0530 @@ -169,5 +169,5 @@ def __unicode__(self): return u"%s %s %s"%(self.sent_to, self.message, self.sent_date.ctime()) -tagging.register(Profile) -tagging.register(Task) +#tagging.register(Profile) +#tagging.register(Task) diff -r 679c7e237052 -r 84ec0ca5bc68 taskapp/views/task.py --- 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. """ diff -r 679c7e237052 -r 84ec0ca5bc68 urls.py --- a/urls.py Tue Mar 09 11:39:34 2010 +0530 +++ b/urls.py Wed Jan 05 18:48:14 2011 +0530 @@ -58,5 +58,7 @@ (r'^user/make/(\w+)/$', userViews.change_rights), (r'^about/(\w+)/$', userViews.learn_more), + + (r'^textbook/$', taskViews.show_textbooks), )