Exemple #1
0
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})    
Exemple #2
0
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})
Exemple #4
0
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})
Exemple #5
0
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})
Exemple #6
0
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')
Exemple #7
0
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')
Exemple #8
0
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})