f_name = request.GET.get('fname')
l_name = request.GET.get('lname')
e_mail = request.GET.get('email')
if f_name:
qs = qs.filter(Q(first_name=f_name))
if l_name:
qs = qs.filter(Q(last_name=l_name))
if e_mail:
qs = qs.filter(Q(email=e_mail))
result = '<br>'.join(
str(teacher)
for teacher in qs
)
# return HttpResponse(result)
return render(
request=request,
template_name='teachers_list.html',
context={'teachers_list': result}
)