def get(self, model, property_name):
if type(model) is dict:<EOL><INDENT>if property_name not in model:<EOL><INDENT>return None<EOL><DEDENT>else:<EOL><INDENT>return model[property_name]<EOL><DEDENT><DEDENT>elif hasattr(model, '<STR_LIT>' + property_name):<EOL><INDENT>getter = getattr(model, '<STR_LIT>' + property_name)<EOL>return getter()<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return getattr(model, property_name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>
Get property from model. Use getter if possible.
:param model: model or dict
:param property_name: str, name on the model
:return: mixed