@handle_response_format
@treeio_login_required
def liability_edit(request, liability_id, response_format='html'):
 liability = get_object_or_404(Liability, pk=liability_id)
 if request.POST:
  if ('cancel' not in request.POST):
   form = LiabilityForm(request.user.profile, request.POST, instance=liability)
   if form.is_valid():
    liability = form.save(commit=False)
    convert(liability, 'value')
    return HttpResponseRedirect(reverse('finance_liability_view', args=[liability.id]))
  else:
   return HttpResponseRedirect(reverse('finance_liability_view', args=[liability.id]))
 else:
  form = LiabilityForm(request.user.profile, instance=liability)
 return render_to_response('finance/liability_edit', {'form': form, 'liability': liability}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def liability_edit ( request , liability_id , response_format = 'html' ) : liability = get_object_or_404 ( Liability , pk = liability_id ) if request . POST : if ( 'cancel' not in request . POST ) : form = LiabilityForm ( request . user . profile , request . POST , instance = liability ) if form . is_valid ( ) : liability = form . save ( commit = False ) convert ( liability , 'value' ) return HttpResponseRedirect ( reverse ( 'finance_liability_view' , args = [ liability . id ] ) ) else : return HttpResponseRedirect ( reverse ( 'finance_liability_view' , args = [ liability . id ] ) ) else : form = LiabilityForm ( request . user . profile , instance = liability ) return render_to_response ( 'finance/liability_edit' , { 'form' : form , 'liability' : liability } , context_instance = RequestContext ( request ) , response_format = response_format )
liability edit page .