def set_model_properties_from_dict(model_obj, property_dict):
    """
    Takes a model object and a dict property names mapped to desired values, then sets all of the relevant
    property values on the model object and saves it
    """
    for field, value in property_dict.items():
        setattr(model_obj, field, value)
    model_obj.save()
    return model_obj