def METHOD_NAME(request):
    sponsors = (
        request.db.query(Sponsor).order_by(Sponsor.is_active.desc(), Sponsor.name).all()
    )
    for sponsor in sponsors:
        visibility = [
            "PSF Sponsor" if sponsor.psf_sponsor else None,
            "Infra Sponsor" if sponsor.infra_sponsor else None,
            "One time" if sponsor.one_time else None,
            "Footer" if sponsor.footer else None,
            "Sidebar" if sponsor.sidebar else None,
        ]
        sponsor.visibility = " | ".join([v for v in visibility if v])
    return {"sponsors": sponsors}