예제 #1
0
def clean_columns(json_spec):
    static_config = StaticReportConfiguration.wrap(deepcopy(json_spec))
    report_config = ReportConfiguration.wrap(static_config.config)
    cleaned_columns = []
    for col_spec, wrapped_col in zip(json_spec['config']['columns'],
                                     report_config.report_columns):
        print("Checking column '{}'".format(col_spec['column_id']))
        new_col_spec = clean_spec(col_spec, wrapped_col)
        cleaned_columns.append(order_dict(new_col_spec, COLUMN_PARAMS_ORDER))
    return cleaned_columns
예제 #2
0
def clean_columns(json_spec):
    static_config = StaticReportConfiguration.wrap(deepcopy(json_spec))
    report_config = ReportConfiguration.wrap(static_config.config)
    cleaned_columns = []
    for col_spec, wrapped_col in zip(json_spec['config']['columns'],
                                     report_config.report_columns):
        print("Checking column '{}'".format(col_spec['column_id']))
        new_col_spec = clean_spec(col_spec, wrapped_col)
        cleaned_columns.append(order_dict(new_col_spec, COLUMN_PARAMS_ORDER))
    return cleaned_columns
예제 #3
0
 def test_wrap(self):
     wrapped = StaticReportConfiguration.wrap(
         self.get_json('static_report_config'))
     self.assertEqual(["example", "dimagi"], wrapped.domains)
예제 #4
0
 def test_wrap(self):
     wrapped = StaticReportConfiguration.wrap(self.get_json('static_report_config'))
     self.assertEqual(["example", "dimagi"], wrapped.domains)