Ejemplo n.º 1
0
def builtin(request):
    if request.method == "POST":
        form = forms.SampleForm(request.POST, request.FILES)
        if form.is_valid():
            First_Name = form.cleaned_data.get('First_Name')
            Last_Name = form.cleaned_data.get('Last_Name')
            Email = form.cleaned_data.get('Email')
            PhoneNumber = form.cleaned_data.get('PhoneNumber')
            Password = form.cleaned_data.get('Password')
            birth_day = form.cleaned_data.get('birth_day')
            birth_month = form.cleaned_data.get('birth_month')
            birth_year = form.cleaned_data.get('birth_year')
            Gender = form.cleaned_data.get('Gender')
            Prog_Languages = form.cleaned_data.get('Prog_Languages')
            Languages = form.cleaned_data.get('Languages')
            Image = form.cleaned_data.get('Image')
            store_Image(Image)
            data = form.cleaned_data
            return render(request, "display_data.html", context=data)
    form = forms.SampleForm()
    return render(request, "builtin.html", {'form': form})


#forms is a file or a library
#in forms Form is a class so we inherit from forms.Form
Ejemplo n.º 2
0
def builtinforms(request):
    if request.method == "POST":
        form = forms.SampleForm(
            request.POST, request.FILES
        )  #im creating a form instance with the data filled the all the firlds will get th
        #the specified value
        if form.is_valid():
            #cleaned_data is varible in form instance that holds the dictonary containing the data that we
            #have filled
            first_name = form.cleaned_data.get('first_name')
            last_name = form.cleaned_data.get('last_name')
            email = form.cleaned_data.get('email')
            phno = form.cleaned_data.get('phno')
            pwd = form.cleaned_data.get('pwd')
            birth_day = form.cleaned_data.get('birth_day')
            birth_month = form.cleaned_data.get('birth_month')
            birth_year = form.cleaned_data.get('birth_year')
            gender = form.cleaned_data.get('gender')
            image = form.cleaned_data.get('image')
            #store_image(image)
            data = form.cleaned_data
            return render(request, "display_data.html", context=data)
    form = forms.SampleForm()
    return render(request, 'builtin.html', {'form': form})


#forms is a file or a library
#in forms Form is a class so we inherit from forms.Form
Ejemplo n.º 3
0
def builtinforms(request):

    if request.method == "POST":

        # Creating a form instance with the data filled in all fields will get the specified value
        form = forms.SampleForm(request.POST)

        if form.is_valid():

            # cleaned_data is variable in form instance that holds the dictionary containing the data
            # that we have filled
            first_name = form.cleaned_data.get('first_name')
            last_name = form.cleaned_data.get('last_name')
            email = form.cleaned_data.get('email')
            phno = form.cleaned_data.get('phno')
            pwd = form.cleaned_data.get('pwd')
            birth_day = form.cleaned_data.get('birth_day')
            birth_month = form.cleaned_data.get('birth_month')
            birth_year = form.cleaned_data.get('birth_year')
            gender = form.cleaned_data.get('gender')
            data = form.cleaned_data
            return render(request, "displaydata.html", context=data)

    form = forms.SampleForm()
    return render(request, "builtinform.html", {'form': form})


#forms is a file or a library
#in forms Form is a class so we inherit from forms.Form
Ejemplo n.º 4
0
Archivo: views.py Proyecto: Souvikpy/p8
def home(request):
    if request.method == "POST":
        form = forms.SampleForm(request.POST, request.FILES)
        if form.is_valid() == False:
            return render(request, "app/sample.html", {'form': form})
        else:
            data = form.cleaned_data
            profile_pic = data['profile_pic']
            utilities.store_image(profile_pic)
            print(form.cleaned_data)
    form = forms.SampleForm()
    return render(request, "app/sample.html", {'form': form})
Ejemplo n.º 5
0
def builtinforms(request):
    form=forms.SampleForm()
    return render(request,'builtin.html',{'form':form})


# forms is a file or a library
# in forms Form is a class so we inherit from forms.Form
Ejemplo n.º 6
0
def builtin(request):

    if request.method == "POST":
        form = forms.SampleForm(request.POST)
        if form.is_valid():
            first_name = form.cleaned_data.get('first_name')
            last_name = form.cleaned_data.get('last_name')
            email = form.cleaned_data.get('email')
            phno = form.cleaned_data.get('phno')
            pwd = form.cleaned_data.get('pwd')
            birth_day = form.cleaned_data.get('birth_day')
            birth_month = form.cleaned_data.get('birth_month')
            birth_year = form.cleaned_data.get('birth_year')
            gender = form.cleaned_data.get('gender')
            image = form.cleaned_data.get('image')
            languages = form.cleaned_data.get('languages')
            store_image(image)
            data = form.cleaned_data
            return render(request, "display_data.html", context=data)

    form = forms.SampleForm()
    return render(request, 'builtin.html', {'form': form})
Ejemplo n.º 7
0
def builtinforms(request):
    form = forms.SampleForm()
    return render(request, 'builtinform.html', {'form': form})
Ejemplo n.º 8
0
def builtin(request):
    form = forms.SampleForm()
    return render(request, "builtin.html", {'form': form})