Creates a setter that will set the specified model attribute
    to the current value.
    @param attr_name: the name of an attribute belonging to the model.
    @type attr_name: str

def model_attr(attr_name):
    """
    Creates a setter that will set the specified model attribute
    to the current value.
    @param attr_name: the name of an attribute belonging to the model.
    @type attr_name: str
    """

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

    return model_attr