示例#1
0
def directoryservice_idmap_adex(request, id):
    idmap_ad = models.idmap_adex.objects.get(id=id)

    if request.method == "POST":
        form = forms.idmap_adex_Form(request.POST, instance=idmap_ad)
        if form.is_valid():
            form.save()
            return JsonResp(request, message="Idmap adex successfully edited.")
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_adex_Form(instance=idmap_ad)

    return render(request, 'directoryservice/idmap_adex.html', {'form': form})
示例#2
0
文件: views.py 项目: Cbrdiv/freenas
def directoryservice_idmap_adex(request, id):
    idmap_ad = models.idmap_adex.objects.get(id=id)

    if request.method == "POST":
        form = forms.idmap_adex_Form(request.POST, instance=idmap_ad)
        if form.is_valid():
            form.save()
            return JsonResp(
                request,
                message="Idmap adex successfully edited."
            )
        else:
            return JsonResp(request, form=form)
    else:
        form = forms.idmap_adex_Form(instance=idmap_ad)

    return render(request, 'directoryservice/idmap_adex.html', {
        'form': form
    })