def METHOD_NAME(request):
    schools = School.objects.filter(is_active=True)
    num_hints = getattr(settings, 'NUM_HINTS', 10)
    if 'postal_code' in request.POST and request.POST['postal_code']:
        schools = schools.filter(postal_code=request.POST['postal_code'])
    elif 'city' in request.POST and request.POST['city']:
        schools = schools.filter(city=request.POST['city'])
    elif 'province' in request.POST and request.POST['province']:
        schools = schools.filter(province=request.POST['province'])
    if 'address' in request.POST and request.POST['address']:
        address = request.POST['address']
        qobj = Q(address=address)
        for w in address.split():
            qobj |= Q(address__contains=w)
        # priority for schools with a matching part of the address
        schools = list(schools.filter(qobj)[:num_hints]) + list(
            schools.filter(~qobj)[:num_hints]
        )
    schools = schools[:num_hints]
    if schools:
        return SimpleTemplateResponse(
            'oi/schools_similar_confirm.html', {'schools': schools}
        )
    else:
        return HttpResponse('')