@handle_response_format
@treeio_login_required
def equity_edit(request, equity_id, response_format='html'):
 equity = get_object_or_404(Equity, pk=equity_id)
 if request.POST:
  if ('cancel' not in request.POST):
   form = EquityForm(request.user.profile, request.POST, instance=equity)
   if form.is_valid():
    equity = form.save()
    return HttpResponseRedirect(reverse('finance_equity_view', args=[equity.id]))
  else:
   return HttpResponseRedirect(reverse('finance_equity_view', args=[equity.id]))
 else:
  form = EquityForm(request.user.profile, instance=equity)
 return render_to_response('finance/equity_edit', {'form': form, 'equity': equity}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def equity_edit ( request , equity_id , response_format = 'html' ) : equity = get_object_or_404 ( Equity , pk = equity_id ) if request . POST : if ( 'cancel' not in request . POST ) : form = EquityForm ( request . user . profile , request . POST , instance = equity ) if form . is_valid ( ) : equity = form . save ( ) return HttpResponseRedirect ( reverse ( 'finance_equity_view' , args = [ equity . id ] ) ) else : return HttpResponseRedirect ( reverse ( 'finance_equity_view' , args = [ equity . id ] ) ) else : form = EquityForm ( request . user . profile , instance = equity ) return render_to_response ( 'finance/equity_edit' , { 'form' : form , 'equity' : equity } , context_instance = RequestContext ( request ) , response_format = response_format )
equity edit page .