コード例 #1
0
ファイル: user.py プロジェクト: zhouyanjiang/kedacmo
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)