taskapp/views/task.py
changeset 215 84ec0ca5bc68
parent 205 0c317f68df49
child 217 307f699e6102
equal deleted inserted replaced
214:679c7e237052 215:84ec0ca5bc68
    16 def browse_tasks(request):
    16 def browse_tasks(request):
    17     """ display all the tasks """
    17     """ display all the tasks """
    18     
    18     
    19     user = get_user(request.user) if request.user.is_authenticated() else request.user
    19     user = get_user(request.user) if request.user.is_authenticated() else request.user
    20     task_list = Task.objects.exclude(status="UP").exclude(status="DL").order_by('published_datetime').reverse()
    20     task_list = Task.objects.exclude(status="UP").exclude(status="DL").order_by('published_datetime').reverse()
       
    21     
       
    22     context = {'user':user,
       
    23                'task_list':task_list,
       
    24                }
       
    25     return render_to_response('task/browse.html', context)
       
    26 
       
    27 def show_textbooks(request):
       
    28     """ display all the tasks """
       
    29     
       
    30     user = get_user(request.user) if request.user.is_authenticated() else request.user
       
    31     task_list = Task.objects.exclude(status="UP").exclude(status="DL").order_by('published_datetime').reverse()
       
    32 
       
    33     textbooks = task_list.filter(tags_field__icontains="textbook")
    21     
    34     
    22     context = {'user':user,
    35     context = {'user':user,
    23                'task_list':task_list,
    36                'task_list':task_list,
    24                }
    37                }
    25     return render_to_response('task/browse.html', context)
    38     return render_to_response('task/browse.html', context)