def adduser(request): if request.method == 'POST': form = AddUserForm(request.POST) if form.is_valid(): user = form.save(commit=False) user.set_password(form.cleaned_data['password']) form.save() return HttpResponseRedirect(reverse('listuserurl')) else: form = AddUserForm() kwvars = { 'form': form, 'request': request, } return render_to_response('UserManage/user.add.html', kwvars, RequestContext(request))
def AddUser(request): if request.method=='POST': form = AddUserForm(request.POST) if form.is_valid(): user = form.save(commit=False) user.set_password(form.cleaned_data['password']) form.save() return HttpResponseRedirect(reverse('listuserurl')) else: form = AddUserForm() kwvars = { 'form':form, 'request':request, } return render_to_response('UserManage/user.add.html',kwvars,RequestContext(request))
def AddUser(request): if request.method == "POST": form = AddUserForm(request.POST) if form.is_valid(): user = form.save(commit=False) user.set_password(form.cleaned_data["password"]) form.save() return HttpResponseRedirect(reverse("listuserurl")) else: form = AddUserForm() kwvars = {"form": form, "request": request} return render_to_response("UserManage/user.add.html", kwvars, RequestContext(request))