def METHOD_NAME(self, **kw):
    if 'id' in kw and kw['id']:
        item = ConfigItem.by_id(kw['id'])
    else:
        flash(_(u"Error: No item ID"))
        raise redirect(".")
    if kw['valid_from']:
        try:
            valid_from = datetime.strptime(kw['valid_from'], '%Y-%m-%d %H:%M')
        except ValueError:
            flash(_(u"Invalid date and time specification, use: YYYY-MM-DD HH:MM"))
            raise redirect("/configuration/edit?id=%d" % item.id)
    else:
        valid_from = None
    try:
        item.set(kw['value'], valid_from, identity.current.user)
    except Exception, msg:
        flash(_(u"Failed to save setting: %s" % msg))
        raise redirect("/configuration/edit?id=%d" % item.id)
    flash(_(u"%s saved" % item.name))
    redirect(".")