# šis parādās pie metodes GET (kad ievadam /show-name)
returnrender(
request,
template_name='form.html',
)
defform(request):
defform(request):
# ja submit, tad metode POST
ifrequest.method=='POST':
ifrequest.method=='POST':
# input nosaukums
fullname=request.POST['fullname']
fullname=request.POST['fullname']
mathematics=int(request.POST['mathematics'])
mathematics=int(request.POST['mathematics'])
latvian_lng=int(request.POST['latvian_lng'])
latvian_lng=int(request.POST['latvian_lng'])
@ -51,7 +15,6 @@ def form(request):
else:
else:
returnHttpResponse(f'Hello, {fullname}! You can apply to our university. Your grades: Mathematics: {mathematics}, Latviesu vld: {latvian_lng}, Svesvaloda: {foreign_lng}')
returnHttpResponse(f'Hello, {fullname}! You can apply to our university. Your grades: Mathematics: {mathematics}, Latviesu vld: {latvian_lng}, Svesvaloda: {foreign_lng}')
# šis parādās pie metodes GET (kad ievadam /show-name)