Exemplo n.º 1
0
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})
Exemplo n.º 2
0
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})
Exemplo n.º 3
0
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})
Exemplo n.º 4
0
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})
Exemplo n.º 5
0
def EmpView(request):
    form = forms.EmpForm()
    MyDict = {'form': form}
    return render(request, 'WebApp/Welcome.html', MyDict)
Exemplo n.º 6
0
def EmpView(request):
    form = forms.EmpForm()
    if request.method == 'POST':
        form = forms.EmpForm(request.POST)