(domain, upstream_link, apps, fixtures, reports, keywords,
                                                timezone, is_superuser=False)
return linked_data_view_models
Data models that originated in this domain's upstream domain that are available to pull
    :return: list of view models (dicts) used to render linked data models that can be pulled
Data models that originated in this domain's upstream domain that are available to pull
    :return: list of view models (dicts) used to render linked data models that can be pulled
Data models that originated in this domain s upstream domain that are available to pull : return : list of view models ( dicts ) used to render linked data models that can be pulled
def build_pullable_view_models_from_data_models(domain, upstream_link, apps, fixtures, reports, keywords,
                                                timezone, is_superuser=False):
    """
    Data models that originated in this domain's upstream domain that are available to pull
    :return: list of view models (dicts) used to render linked data models that can be pulled
    """
    linked_data_view_models = []

    if not upstream_link:
        return linked_data_view_models

    models_seen = set()
    history = get_actions_in_domain_link_history(upstream_link)
    for action in history:
        if action.row_number != 1:
            # first row is the most recent
            continue

        models_seen.add(action.model)
        last_update = server_to_user_time(action.date, timezone)

        if action.model == MODEL_APP:
            app = pop_app_for_action(action, apps)
            view_model = build_app_view_model(app, last_update=last_update)
        elif action.model == MODEL_FIXTURE:
            fixture = pop_fixture_for_action(action, fixtures, domain)
            view_model = build_fixture_view_model(fixture, last_update=last_update)
        elif action.model == MODEL_REPORT:
            report = pop_report_for_action(action, reports)
            view_model = build_report_view_model(report, last_update=last_update)
        elif action.model == MODEL_KEYWORD:
            keyword = pop_keyword_for_action(action, keywords)
            view_model = build_keyword_view_model(keyword, last_update=last_update)
        else:
            view_model = build_linked_data_view_model(
                model_type=action.model,
                name=LINKED_MODELS_MAP[action.model],
                detail=action.model_detail,
                last_update=last_update,
            )
        if view_model:
            if view_model['type'] not in dict(SUPERUSER_DATA_MODELS).keys() or is_superuser:
                linked_data_view_models.append(view_model)

    # Add data models that have never been pulled into the downstream domain before
    # ignoring any models we have already added via domain history
    linked_data_view_models.extend(
        build_view_models_from_data_models(
            domain, apps, fixtures, reports, keywords, ignore_models=models_seen, is_superuser=is_superuser)
    )

    return linked_data_view_models
def build_pullable_view_models_from_data_models ( domain , upstream_link , apps , fixtures , reports , keywords , timezone , is_superuser = False ) : linked_data_view_models = [ ] if not upstream_link : return linked_data_view_models models_seen = set ( ) history = get_actions_in_domain_link_history ( upstream_link ) for action in history : if action . row_number != 1 : # first row is the most recent continue models_seen . add ( action . model ) last_update = server_to_user_time ( action . date , timezone ) if action . model == MODEL_APP : app = pop_app_for_action ( action , apps ) view_model = build_app_view_model ( app , last_update = last_update ) elif action . model == MODEL_FIXTURE : fixture = pop_fixture_for_action ( action , fixtures , domain ) view_model = build_fixture_view_model ( fixture , last_update = last_update ) elif action . model == MODEL_REPORT : report = pop_report_for_action ( action , reports ) view_model = build_report_view_model ( report , last_update = last_update ) elif action . model == MODEL_KEYWORD : keyword = pop_keyword_for_action ( action , keywords ) view_model = build_keyword_view_model ( keyword , last_update = last_update ) else : view_model = build_linked_data_view_model ( model_type = action . model , name = LINKED_MODELS_MAP [ action . model ] , detail = action . model_detail , last_update = last_update , ) if view_model : if view_model [ 'type' ] not in dict ( SUPERUSER_DATA_MODELS ) . keys ( ) or is_superuser : linked_data_view_models . append ( view_model ) # Add data models that have never been pulled into the downstream domain before # ignoring any models we have already added via domain history linked_data_view_models . extend ( build_view_models_from_data_models ( domain , apps , fixtures , reports , keywords , ignore_models = models_seen , is_superuser = is_superuser ) ) return linked_data_view_models