Patstāvīgais darbs 11.11.2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
783 B

from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def form(request):
if request.method == 'POST':
fullname = request.POST['fullname']
mathematics = int(request.POST['mathematics'])
latvian_lng = int(request.POST['latvian_lng'])
foreign_lng = int(request.POST['foreign_lng'])
if mathematics < 40 or latvian_lng < 40 or foreign_lng < 40:
return HttpResponse(f'{fullname} can not apply to university')
else:
return HttpResponse(f'Hello, {fullname}! You can apply to our university. Your grades: Mathematics: {mathematics}, Latviesu vld: {latvian_lng}, Svesvaloda: {foreign_lng}')
return render(
request,
template_name='form.html',
)