コード例 #1
0
	def post(self,request,*args,**kwargs):
		form=RegistrationForm(request.POST)
		context={
		"title":"testing",
		"form":form
		}

		if form.is_valid():
			mail=form.cleaned_data.get('email')
			name=form.cleaned_data.get('name')
			phone=form.cleaned_data.get('phone')
			college=form.cleaned_data.get('college')
			stay=form.cleaned_data.get('stay')
			code=uniqueid('6')
			u=userinfo(excelid=code,name=name,college=college,email=mail,phone=phone,stay=stay,present=True)
			u.save()
			#flag for offlinereg or paidreg
			flag=0

			context = {
				"excelid":code,
				"flag" : flag
			}
			return render(request,"excelid.html",context)
		return render(request,"offlinereg.html",context)
コード例 #2
0
ファイル: views.py プロジェクト: Augustinetharakan12/Alfred
	def post(self,request,*args,**kwargs):
		form=registrationform(request.POST)
		context={
		"title":"testing",
		"form":form
		}

		if form.is_valid():
			mail=form.cleaned_data.get('email')
			name=form.cleaned_data.get('name')
			phone=form.cleaned_data.get('phone')
			college=form.cleaned_data.get('college')
			stay=form.cleaned_data.get('stay')
			code=uniqueid('6')
			u=userinfo(excelid=code,name=name,college=college,email=mail,phone=phone,stay=stay,present=True)
			u.save()
			#flag for offlinereg or paidreg
			flag=0

			context = {
				"excelid":code,
				"flag" : flag 
			}
			return render(request,"excelid.html",context)
		return render(request,"offlinereg.html",context)
コード例 #3
0
ファイル: mecgen.py プロジェクト: abinmn/excel2018-accounts
def generateId(classcode, year, file):
    college="Model Engineering College"
    id = classcode+year
    csv_file = open(file, 'r')
    csv_reader = csv.reader(csv_file, delimiter=",")
    count = 0
    for row in csv_reader:
        if count!=0 and len(row[0])>0:
            name = row[0]
            email = row[1]
            phone_number = row[2]
            if count<10:
                excel_id = 'EX' + year + classcode + '0' + str(count)
            else:
                excel_id = 'EX' + year + classcode + str(count)
            object = userinfo(excelid=excel_id, name=name, college=college, email=email, phone=phone_number, outsider=False, present=True)
            object.save()
        count += 1
コード例 #4
0
ファイル: views.py プロジェクト: jayarajbalagopal/excelreg
    def post(self, request, *args, **kwargs):
        form = registrationform(request.POST)
        context = {"title": "testing", "form": form}
        if form.is_valid():
            mail = form.cleaned_data.get('email')
            name = form.cleaned_data.get('name')
            phone = form.cleaned_data.get('phone')
            college = form.cleaned_data.get('college')
            u = userinfo(name=name, college=college, email=mail, phone=phone)
            u.save()
            obj = userinfo.objects.get(email=mail)
            im = pyqrcode.create(obj.excelid)
            im.svg('static/qrcodes/%s.svg' % (obj.excelid), scale=20)
            return render(request, "success.html", {"object": obj})
# im=pyqrcode.create(obj.excelid)
# im.svg('static/qrcodes/%s.svg'%(obj.excelid), scale=20)
# return render(request,"success.html",{"object":obj})

        return render(request, "home.html", context)
コード例 #5
0
ファイル: views.py プロジェクト: abinmn/excel2018-accounts
    def post(self, request, *args, **kwargs):
        form = StudentForm(request.POST)
        context = {"title": "testing", "form": form}

        if form.is_valid():
            name = form.cleaned_data.get('Name')
            college = form.cleaned_data.get('College')
            code = 'EX' + uniqueid(9)
            u = userinfo(excelid=code,
                         name=name,
                         college=college,
                         stay=False,
                         present=True)
            u.save()
            #flag for offlinereg or paidreg
            flag = 2

            context = {"excelid": code, "flag": flag}
            return render(request, "excelid.html", context)
        return render(request, "studentreg.html", context)
コード例 #6
0
	def post(self,request,*args,**kwargs):
		form = RegistrationForm()
		context = {
		"title": "testing",
		"form": form
		}
		if form.is_valid():
			mail = form.cleaned_data.get('email')
			name = form.cleaned_data.get('name')
			phone = form.cleaned_data.get('phone')
			college = form.cleaned_data.get('college')
			stay1 = form.cleaned_data.get('stay')
			code = uniqueid('6')
			u = userinfo(excelid=code, name=name, college=college, email=mail, phone=phone, stay=stay1)
			u.save()
			# obj=userinfo.objects.get(email=mail)
			# im=pyqrcode.create(obj.excelid)
			# im.svg('static/qrcodes/%s.svg'%(obj.excelid),scale=20)
			return render(request,"success.html",{"name":name})

		return render(request,"home.html",context)
コード例 #7
0
ファイル: views.py プロジェクト: Augustinetharakan12/Alfred
	def post(self,request,*args,**kwargs):

		form=registrationform(request.POST)
		context={
		"title":"testing",
		"form":form
		}
		if form.is_valid():
			mail=form.cleaned_data.get('email')
			name=form.cleaned_data.get('name')
			phone=form.cleaned_data.get('phone')
			college=form.cleaned_data.get('college')
			stay1=form.cleaned_data.get('stay')
			code=uniqueid('6')
			u=userinfo(excelid=code,name=name,college=college,email=mail,phone=phone,stay=stay1)
			u.save()
			# obj=userinfo.objects.get(email=mail)
			# im=pyqrcode.create(obj.excelid)
			# im.svg('static/qrcodes/%s.svg'%(obj.excelid),scale=20)
			return render(request,"success.html",{"name":name})

		return render(request,"home.html",context)
コード例 #8
0
ファイル: views.py プロジェクト: Augustinetharakan12/Alfred
	def post(self,request,*args,**kwargs):
		form=studentform(request.POST)
		context={
		"title":"testing",
		"form":form
		}

		if form.is_valid():
			name=form.cleaned_data.get('name')
			college=form.cleaned_data.get('college')
			code=uniqueid('9')
			u=userinfo(excelid=code,name=name,college=college,stay=False,present=True)
			u.save()
			#flag for offlinereg or paidreg
			flag=2

			context = {
				"excelid":code,
				"flag" : flag 
			}
			return render(request,"excelid.html",context)
		return render(request,"studentreg.html",context)
コード例 #9
0
ファイル: views.py プロジェクト: abinmn/excel2018-accounts
    def post(self, request, *args, **kwargs):
        form = RegistrationForm(request.POST)
        context = {"title": "testing", "form": form}
        print(form)
        if form.is_valid():
            mail = form.cleaned_data.get('email')
            name = form.cleaned_data.get('name')
            phone = form.cleaned_data.get('phone')
            college = form.cleaned_data.get('college')
            code = 'EX' + uniqueid(7)
            u = userinfo(excelid=code,
                         name=name,
                         college=college,
                         email=mail,
                         phone=phone,
                         outsider=True)
            u.save()
            # obj=userinfo.objects.get(email=mail)
            # im=pyqrcode.create(obj.excelid)
            # im.svg('static/qrcodes/%s.svg'%(obj.excelid),scale=20)
            context = {"excelid": code, "flag": 2}
            return render(request, "excelid.html", context)

        return render(request, "home.html", context)