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 FROM INVSALID') return render(request, 'users.html', {'form': form})
def users(request): # user_list = User.objects.order_by('LastName') # user_dict = {'users': user_list} # return render(request, 'AppTwo/user.html', context=user_dict) f = NewUserForm() if request.method == 'POST': f = NewUserForm(request.POST) if f.is_valid(): f.save(commit=True) return index(request) else: print('ERROR FOR IS INVALID') return render(request, 'AppTwo/users.html', {'form': f})
def signup(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,"AppTwo/signup.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 IS INVALID') return render(request, 'AppTwo/user.html', {'form': form})
def users(request): # user_list = User.objects.order_by('FirstName') # user_dict = {'users':user_list} # return render(request,'AppTwo/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 Form Invalid") return render(request, 'AppTwo/users.html', {'form': form})
def users(request): form = NewUserForm() if request.method == "POST": form = NewUserForm(request.POST) # checks if input information was entered in correctly if form.is_valid(): form.save(commit=True) # return the index view of the request/ take you back to the homepage return index(request) else: print('ERROR FORM INVALAD') return render(request, 'AppTwo/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, 'AppTwo/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) #TODO else: print('ERROR COUNTERED !') return render(request, 'AppTwo/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) # saves to the db return index(request) # redirect to index page # print("first:" + form.cleaned_data['first_name']) # print("Last:" + form.cleaned_data['last_name']) # print("email:" + form.cleaned_data['email']) else: print("ERROR FORM INVALID") return render(request, 'AppTwo/model_form.html', {'form': form})
def show_user_info(request): """ user_list = User.objects.order_by('first_name') user_dict = {'userinfo': user_list} return render(request, "AppTwo/showuserinfo.html", context=user_dict) """ form = NewUserForm() if request.method == "POST": form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return default(request) else: print('Error form invalid') return render(request, "AppTwo/showuserinfo.html", context={'form': form})
def users(request): # user_list=User.objects.order_by("first_name") # user_dict={"user":user_list} # return render(request,'AppTwo/user.html',context=user_dict) form = NewUserForm() if request.method == "POST": #Someone hit submit and sends the information back form = NewUserForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) # Take back to the home page else: print('ERROR FORM INVALID') return render(request, 'AppTwo/user.html', {'form': form})
def users(request): # users = User.objects.order_by('email') # user_dict = {'user_records' : users} # return render(request, 'AppTwo/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 FORM INVALID') return render(request, 'AppTwo/users.html', {'form': form})
def users(request): form = NewUserForm() if request.method == 'POST': form = forms.NewUserForm(request.POST) if form.is_valid(): #DO SOMETHING LANGUAGE_CODE form.save(commit=True) return index(request) else: print('ERROR FORM INVALID') return render(request, 'AppTwo/user.html', {'form': form})