Creates a setter that will set the model attribute with context's key
    for name to the current value.

def model_setattr():
    """
    Creates a setter that will set the model attribute with context's key
    for name to the current value.
    """

    def model_setattr(value, context, **_params):
        setattr(context["model"], context["key"], value)
        return _attr()

    return model_setattr