def users(request): form = NewUserForm if request.method == "POST": form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print('ERROR FORM INVALID') return render(request, 'second_app/users.html', {'form':form})
def users(request): form = NewUserForm if request.method == 'POST': form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print('Form is Invalid') return render(request,'second_app/users.html',{'form':form})
def index(request): form = NewUserForm() if request.method == 'POST': form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return ind(request) raise ValidationError("Form Is Invalid!") return render(request, 'second_app/users.html', {'form': form})
def users(request): form = NewUserForm() if request.method == "POST": form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print("ERROR,Form Invalid") return render(request, 'second_app/users.html', {'forms': form})
def userInfo(request): # user_list = User.objects.order_by('first_name') # user_dict = {'users_info' : user_list} # return render(request, 'second_app/user.html', context = user_dict) form = NewUserForm() if request.method == "POST": form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return home(request) else: print("ERROR FORM INVALID") return render(request, 'second_app/user.html', {'form': form})
def user(request): form = NewUserForm() if request.method == "POST": form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print('ERROR FORM INVALID') return render(request, 'second_app/users.html', {'form': form}) '''users_list = User.objects.order_by('first_name')
def users(request): form = NewUserForm() if request.method == 'POST': form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print("Error Sign Up") return render(request, 'second_app/users.html', {'form': form}) '''user_list = User.objects.order_by('first_name')
def sign_up(request): form = NewUserForm() if request.method == 'POST': form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print("ERROR FORM INVALID") return render(request, 'second_app/sign_up.html', {'form': form})
def users(request): # user_list = User.objects.order_by('first_name') # user_dict = {'users': user_list} # return render(request, 'second_app/users.html', context=user_dict) form = NewUserForm() if request.method == "POST": form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print("Error!") return render(request, "second_app/users.html", {'form': form})