Ejemplo n.º 1
0
def form(request):
	if request.method == 'POST':
	 
		form = AddForm(request.POST,request.FILES)

		if form.is_valid():
			#获取表单信息
			name = form.cleaned_data['Name']
			studentid= form.cleaned_data['Studentid']
			email= form.cleaned_data['Email']
			mobilephone= form.cleaned_data['Mobile_Phone']
			profile= form.cleaned_data['Profile']
			cv= form.cleaned_data['CV']            
			#写入数据库
			application = Application()
			application.name = name
			application.studentid = studentid
			application.email=email
			application.cellphone=mobilephone
			application.profile=profile
			application.cv=cv
			application.save()
			return HttpResponse('Submitted')
	 
	else:
		form = AddForm()
	return render(request, 'form.html', {'form': form})
Ejemplo n.º 2
0
def applicationplus(request):  
	a = request.GET['name']
	b = request.GET['studentid']
	c = request.GET['email']
	d = request.GET['cellphone']
	e = request.GET['profile']
	a=str(a)
	b=str(b)
	c=str(c)
	d=str(d)
	e=str(e)
	f= Application(name=a,studentid=b,email=c,cellphone=d,profile=e)
	f.save()
	return render(request,'index.html')
Ejemplo n.º 3
0
def join(requests):
    if requests.method == 'POST':
        name = requests.POST.get("name")
        email = requests.POST.get("email")
        desc = requests.POST.get("desc")
        phone = requests.POST.get("phone")
        position = requests.POST.get("position")
        instance = Application(name=name,
                               email=email,
                               desc=desc,
                               phone=phone,
                               position=position)
        instance.save()

    return render(requests, 'join.html')