Return the compilation context for py3o templating

    Build a deep dict representation of the given instance and add config values

    :param obj instance: a SQLAlchemy model instance
    :return: a multi level dict with context datas
    :rtype: dict

def get_compilation_context(instance):
    """
    Return the compilation context for py3o templating

    Build a deep dict representation of the given instance and add config values

    :param obj instance: a SQLAlchemy model instance
    :return: a multi level dict with context datas
    :rtype: dict
    """
    context_builder = SqlaContext(instance.__class__)
    py3o_context = context_builder.compile_obj(instance)
    return py3o_context