def METHOD_NAME(request):
    for feat in models.Feature.all(request.db):
        for attr in ["everyone", "first_party", "admins", "staff"]:
            val = request.POST.get(f"{feat.name}[{attr}]")
            if val == "on":
                setattr(feat, attr, True)
            else:
                setattr(feat, attr, False)
        for cohort in request.db.query(models.FeatureCohort).all():
            val = request.POST.get(f"{feat.name}[cohorts][{cohort.name}]")
            if val == "on":
                if cohort not in feat.cohorts:
                    feat.cohorts.append(cohort)
            elif cohort in feat.cohorts:
                feat.cohorts.remove(cohort)
    request.session.flash(_("Changes saved."), "success")
    return httpexceptions.HTTPSeeOther(location=request.route_url("admin.features"))