def update_model(raw_model, app_model, forbidden_keys=None, inverse=False):
if forbidden_keys is None:<EOL><INDENT>forbidden_keys = []<EOL><DEDENT>if type(app_model) != dict:<EOL><INDENT>app_model = app_model.__dict__<EOL><DEDENT>if inverse:<EOL><INDENT>for k in app_model:<EOL><INDENT>logging.debug("<STR_LIT>".format(k))<EOL>if (hasattr(raw_model, k)) and (k not in forbidden_keys):<EOL><INDENT>logging.debug("<STR_LIT>".format(k, app_model[k]))<EOL>setattr(raw_model, k, app_model[k])<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for k in raw_model.__dict__:<EOL><INDENT>logging.debug("<STR_LIT>".format(k))<EOL>if (k in app_model) and (k not in forbidden_keys):<EOL><INDENT>logging.debug("<STR_LIT>".format(k, app_model[k]))<EOL>setattr(raw_model, k, app_model[k])<EOL><DEDENT><DEDENT><DEDENT>
Updates the `raw_model` according to the values in the `app_model`.

    :param raw_model: Raw model which gets updated.
    :param app_model: App model holding the data.
    :param forbidden_keys: Data/attributes which will not be updated.
    :type forbidden_keys: list
    :param inverse: If the value is `True` all `app_model` attributes which are contained in the `raw_model` are
                    updated. If the value is `False` all `raw_model` properties which are in the `app_model` will be
                    updated.