def EmpView(request): form = forms.EmpForm() if request.method == 'POST': form = forms.EmpForm(request.POST) if form.is_valid(): print("Validations are success folks..!!") print(form.cleaned_data['Name']) print(form.cleaned_data['Salary']) return render(request, 'MyApp/welcome.html', {'form': form})
def Emp_View(request): form = forms.EmpForm() if request.method == 'POST': form = forms.EmpForm(request.POST) if form.is_valid(): form.save(commit=True) print("FORM Data Inserted Successfully") return HttpResponseRedirect('/Thanks') return render(request, 'MyApp/Welcome.html', {'form': form})
def Emp_View(request): form = forms.EmpForm() if request.method == 'POST': form = forms.EmpForm(request.POST) if form.is_valid(): form.save(commit=True) return HttpResponseRedirect('/bye') else: form = forms.EmpForm() return render(request, 'MyApp/Welcome.html', {'form', form})
def EmpView(request): form = forms.EmpForm() if request.method == 'POST': form = forms.EmpForm(request.POST) if form.is_valid(): form.save(commit=True) return HttpResponseRedirect('/thanks') else: form = forms.EmpForm() return render(request, 'WebApp/Registration.html', {'form': form})
def EmpView(request): form = forms.EmpForm() MyDict = {'form': form} return render(request, 'WebApp/Welcome.html', MyDict)
def EmpView(request): form = forms.EmpForm() if request.method == 'POST': form = forms.EmpForm(request.POST)