本文整理匯總了Python中corehq.apps.userreports.models.StaticReportConfiguration.wrap方法的典型用法代碼示例。如果您正苦於以下問題:Python StaticReportConfiguration.wrap方法的具體用法?Python StaticReportConfiguration.wrap怎麽用?Python StaticReportConfiguration.wrap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類corehq.apps.userreports.models.StaticReportConfiguration
的用法示例。
在下文中一共展示了StaticReportConfiguration.wrap方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: clean_columns
# 需要導入模塊: from corehq.apps.userreports.models import StaticReportConfiguration [as 別名]
# 或者: from corehq.apps.userreports.models.StaticReportConfiguration import wrap [as 別名]
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: test_wrap
# 需要導入模塊: from corehq.apps.userreports.models import StaticReportConfiguration [as 別名]
# 或者: from corehq.apps.userreports.models.StaticReportConfiguration import wrap [as 別名]
def test_wrap(self):
wrapped = StaticReportConfiguration.wrap(self.get_json('static_report_config'))
self.assertEqual(["example", "dimagi"], wrapped.domains)