예제 #1
0
def EditUser(request, ID):
    user = get_user_model().objects.get(id=ID)

    if request.method == "POST":
        form = EditUserForm(request.POST, instance=user)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse("listuserurl"))
    else:
        form = EditUserForm(instance=user)

    kwvars = {"ID": ID, "form": form, "request": request}

    return render_to_response("UserManage/user.edit.html", kwvars, RequestContext(request))
예제 #2
0
파일: user.py 프로젝트: eagle2015/OpsAdmin
def EditUser(request,ID):
    user = get_user_model().objects.get(id = ID)
    if request.method=='POST':
        form = EditUserForm(request.POST,instance=user)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('listuserurl'))
    else:
        form = EditUserForm(instance=user
        )
    kwvars = {
        'ID':ID,
        'form':form,
        'request':request,
    }
    return render_to_response('UserManage/user.edit.html',kwvars,RequestContext(request))
예제 #3
0
def edituser(request, num):
    user = get_user_model().objects.get(id=num)
    if request.method == 'POST':
        form = EditUserForm(request.POST, instance=user)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('listuserurl'))
    else:
        form = EditUserForm(instance=user)
    kwvars = {
        'num': num,
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/user.edit.html', kwvars, RequestContext(request))
예제 #4
0
def EditUser(request,ID):
    user = get_user_model().objects.get(id = ID)

    if request.method=='POST':
        form = EditUserForm(request.POST,instance=user)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('listuserurl'))
    else:
        form = EditUserForm(instance=user
        )

    kwvars = {
        'ID':ID,
        'form':form,
        'request':request,
    }

    return render(request,'UserManage/user.edit.html',kwvars)