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))
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))
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))
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)