@handle_response_format
@treeio_login_required
def index_transactions(request, response_format='html'):
 if request.GET:
  query = _get_filter_query(Transaction, request.GET)
 else:
  query = Q()
 if ('massform' in request.POST):
  for key in request.POST:
   if ('mass-transaction' in key):
    try:
     transaction = Transaction.objects.get(pk=request.POST[key])
     form = MassActionForm(request.user.profile, request.POST, instance=transaction)
     if (form.is_valid() and request.user.profile.has_permission(transaction, mode='w')):
      form.save()
    except:
     pass
 massform = MassActionForm(request.user.profile)
 transactions = Object.filter_by_request(request, Transaction.objects.filter(query), mode='r')
 filters = TransactionFilterForm(request.user.profile, 'title', request.GET)
 return render_to_response('finance/index_transactions', {'transactions': transactions, 'massform': massform, 'filters': filters}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def index_transactions ( request , response_format = 'html' ) : if request . GET : query = _get_filter_query ( Transaction , request . GET ) else : query = Q ( ) if ( 'massform' in request . POST ) : for key in request . POST : if ( 'mass-transaction' in key ) : try : transaction = Transaction . objects . get ( pk = request . POST [ key ] ) form = MassActionForm ( request . user . profile , request . POST , instance = transaction ) if ( form . is_valid ( ) and request . user . profile . has_permission ( transaction , mode = 'w' ) ) : form . save ( ) except : pass massform = MassActionForm ( request . user . profile ) transactions = Object . filter_by_request ( request , Transaction . objects . filter ( query ) , mode = 'r' ) filters = TransactionFilterForm ( request . user . profile , 'title' , request . GET ) return render_to_response ( 'finance/index_transactions' , { 'transactions' : transactions , 'massform' : massform , 'filters' : filters } , context_instance = RequestContext ( request ) , response_format = response_format )
index_transactions page: displays all transactions .