(report_data_cache, report_config, restore_user, row_to_element)
return row_elements, filters_elem
Generate restore row and filter elements
    :param row_to_element: function (
                deferred_fields, filter_options_by_field, row, index, is_total_row
            ) -> row_element
Generate restore row and filter elements
    :param row_to_element: function (
                deferred_fields, filter_options_by_field, row, index, is_total_row
            ) -> row_element
Generate restore row and filter elements : param row_to_element : function ( deferred_fields filter_options_by_field row index is_total_row ) - > row_element
def generate_rows_and_filters(report_data_cache, report_config, restore_user, row_to_element):
    """Generate restore row and filter elements
    :param row_to_element: function (
                deferred_fields, filter_options_by_field, row, index, is_total_row
            ) -> row_element
    """
    domain = restore_user.domain
    report, data_source = _get_report_and_data_source(report_config.report_id, domain)

    # apply filters specified in report module
    all_filter_values = {
        filter_slug: restore_user.get_ucr_filter_value(filter, report.get_ui_filter(filter_slug))
        for filter_slug, filter in report_config.filters.items()
    }
    # apply all prefilters
    prefilters = [ReportFilterFactory.from_spec(p, report) for p in report.prefilters]
    prefilter_values = {prefilter.name: prefilter.value() for prefilter in prefilters}
    all_filter_values.update(prefilter_values)
    # filter out nulls
    filter_values = {
        filter_slug: filter_value for filter_slug, filter_value in all_filter_values.items()
        if filter_value is not None
    }
    defer_filters = [
        report.get_ui_filter(filter_slug)
        for filter_slug, filter_value in all_filter_values.items()
        if filter_value is None and is_valid_mobile_select_filter_type(report.get_ui_filter(filter_slug))
    ]
    data_source.set_filter_values(filter_values)
    data_source.set_defer_fields([f.field for f in defer_filters])
    filter_options_by_field = defaultdict(set)

    row_elements = get_report_element(
        report_data_cache,
        report_config,
        data_source,
        {f.field for f in defer_filters},
        filter_options_by_field,
        row_to_element,
    )
    filters_elem = _get_filters_elem(defer_filters, filter_options_by_field, restore_user._couch_user)

    if (report_config.report_id in settings.UCR_COMPARISONS and
        COMPARE_UCR_REPORTS.enabled(uuid.uuid4().hex, NAMESPACE_OTHER)):
        compare_ucr_dbs.delay(domain, report_config.report_id, filter_values)

    return row_elements, filters_elem
def generate_rows_and_filters ( report_data_cache , report_config , restore_user , row_to_element ) : domain = restore_user . domain report , data_source = _get_report_and_data_source ( report_config . report_id , domain ) # apply filters specified in report module all_filter_values = { filter_slug : restore_user . get_ucr_filter_value ( filter , report . get_ui_filter ( filter_slug ) ) for filter_slug , filter in report_config . filters . items ( ) } # apply all prefilters prefilters = [ ReportFilterFactory . from_spec ( p , report ) for p in report . prefilters ] prefilter_values = { prefilter . name : prefilter . value ( ) for prefilter in prefilters } all_filter_values . update ( prefilter_values ) # filter out nulls filter_values = { filter_slug : filter_value for filter_slug , filter_value in all_filter_values . items ( ) if filter_value is not None } defer_filters = [ report . get_ui_filter ( filter_slug ) for filter_slug , filter_value in all_filter_values . items ( ) if filter_value is None and is_valid_mobile_select_filter_type ( report . get_ui_filter ( filter_slug ) ) ] data_source . set_filter_values ( filter_values ) data_source . set_defer_fields ( [ f . field for f in defer_filters ] ) filter_options_by_field = defaultdict ( set ) row_elements = get_report_element ( report_data_cache , report_config , data_source , { f . field for f in defer_filters } , filter_options_by_field , row_to_element , ) filters_elem = _get_filters_elem ( defer_filters , filter_options_by_field , restore_user . _couch_user ) if ( report_config . report_id in settings . UCR_COMPARISONS and COMPARE_UCR_REPORTS . enabled ( uuid . uuid4 ( ) . hex , NAMESPACE_OTHER ) ) : compare_ucr_dbs . delay ( domain , report_config . report_id , filter_values ) return row_elements , filters_elem