Ignore:
Timestamp:
Jul 6, 2014, 4:38:22 AM (11 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master
Children:
7a292ed
Parents:
bc1da44
git-author:
Alex Dehnert <adehnert@…> (07/06/14 04:38:22)
git-committer:
Alex Dehnert <adehnert@…> (07/06/14 04:38:22)
Message:

Replace ListViewWithContext? with simpler render_to_response

It turns out that if you're specifying a queryset and a bunch of extra context,
ListView? isn't *actually* buying much...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remit/vouchers/views.py

    r21360c8 r5f82b6c  
    22from vouchers.models import ReimbursementRequest, Documentation
    33from finance_core.models import BudgetTerm, BudgetArea
    4 from util.shortcuts import get_403_response, ListViewWithContext
     4from util.shortcuts import get_403_response
    55
    66from django.contrib.auth.decorators import user_passes_test, login_required
     
    427427
    428428    # GENERATE THE REQUEST
    429     callable = ListViewWithContext.as_view(
    430         queryset=qs,
    431         extra_context={
    432             'actions' : actions,
    433             'selected_ids'  : list_to_keys(selected_rr_ids),
    434             'action_message': apply_action_message,
    435             'action_errors' : apply_action_errors,
    436             'useronly': useronly,
    437             'order'   : order,
    438             'orders'  : request_list_orders,
    439             'approval_status' : approval_status,
    440             'approval_states':  vouchers.models.APPROVAL_STATES,
    441             'pagename': 'list_requests',
    442         },
    443     )
    444     return callable(http_request)
     429
     430    context = {
     431        'object_list' : qs,
     432        'actions' : actions,
     433        'selected_ids'  : list_to_keys(selected_rr_ids),
     434        'action_message': apply_action_message,
     435        'action_errors' : apply_action_errors,
     436        'useronly': useronly,
     437        'order'   : order,
     438        'orders'  : request_list_orders,
     439        'approval_status' : approval_status,
     440        'approval_states':  vouchers.models.APPROVAL_STATES,
     441        'pagename': 'list_requests',
     442    }
     443    return render_to_response('vouchers/reimbursementrequest_list.html', context, context_instance=RequestContext(http_request), )
Note: See TracChangeset for help on using the changeset viewer.