def set(self, model, property_name, value):
if type(model) is dict:<EOL><INDENT>model[property_name] = value<EOL><DEDENT>elif hasattr(model, '<STR_LIT>' + property_name):<EOL><INDENT>setter = getattr(model, '<STR_LIT>' + property_name)<EOL>setter(value)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>setattr(model, property_name, value)<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Set model property to value. Use setter if possible.
:param model: model object or dict
:param property_name: str, name on the model
:param value: mixed, a value to set
:return: None