def edit(request):
    """
    Process the inline editing form.
    """
    model = apps.get_model(request.POST["app"], request.POST["model"])
    obj = model.objects.get(id=request.POST["id"])
    form = get_edit_form(obj, request.POST["fields"], data=request.POST,
                         files=request.FILES)
    if not (is_editable(obj, request) and has_site_permission(request.user)):
        response = _("Permission denied")
    elif form.is_valid():
        form.save()
        model_admin = ModelAdmin(model, admin.site)
        message = model_admin.construct_change_message(request, form, None)
        model_admin.log_change(request, obj, message)
        response = ""
    else:
        response = list(form.errors.values())[0][0]
    return HttpResponse(response)
def edit ( request ) : model = apps . get_model ( request . POST [ "app" ] , request . POST [ "model" ] ) obj = model . objects . get ( id = request . POST [ "id" ] ) form = get_edit_form ( obj , request . POST [ "fields" ] , data = request . POST , files = request . FILES ) if not ( is_editable ( obj , request ) and has_site_permission ( request . user ) ) : response = _ ( "Permission denied" ) elif form . is_valid ( ) : form . save ( ) model_admin = ModelAdmin ( model , admin . site ) message = model_admin . construct_change_message ( request , form , None ) model_admin . log_change ( request , obj , message ) response = "" else : response = list ( form . errors . values ( ) ) [ 0 ] [ 0 ] return HttpResponse ( response )
Process the inline editing form.