@handle_response_format
@treeio_login_required
def transaction_edit(request, transaction_id, response_format='html'):
 transaction = get_object_or_404(Transaction, pk=transaction_id)
 if request.POST:
  if ('cancel' not in request.POST):
   form = TransactionForm(request.user.profile, None, None, request.POST, instance=transaction)
   if form.is_valid():
    transaction = form.save(commit=False)
    convert(transaction, 'value')
    return HttpResponseRedirect(reverse('finance_transaction_view', args=[transaction.id]))
  else:
   return HttpResponseRedirect(reverse('finance_transaction_view', args=[transaction.id]))
 else:
  form = TransactionForm(request.user.profile, None, None, instance=transaction)
 return render_to_response('finance/transaction_edit', {'form': form, 'transaction': transaction}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def transaction_edit ( request , transaction_id , response_format = 'html' ) : transaction = get_object_or_404 ( Transaction , pk = transaction_id ) if request . POST : if ( 'cancel' not in request . POST ) : form = TransactionForm ( request . user . profile , None , None , request . POST , instance = transaction ) if form . is_valid ( ) : transaction = form . save ( commit = False ) convert ( transaction , 'value' ) return HttpResponseRedirect ( reverse ( 'finance_transaction_view' , args = [ transaction . id ] ) ) else : return HttpResponseRedirect ( reverse ( 'finance_transaction_view' , args = [ transaction . id ] ) ) else : form = TransactionForm ( request . user . profile , None , None , instance = transaction ) return render_to_response ( 'finance/transaction_edit' , { 'form' : form , 'transaction' : transaction } , context_instance = RequestContext ( request ) , response_format = response_format )
transaction edit page .