def filter(self): """ Return the filter configuration for the DataSourceConfiguration. """ if self.source_type == "case": return make_case_data_source_filter(self.source_id) if self.source_type == "form": return make_form_data_source_filter(self.source_xform.data_node.tag_xmlns)
def filter(self): """ Return the filter configuration for the DataSourceConfiguration. """ if self.source_type == "case": return make_case_data_source_filter(self.source_id) if self.source_type == "form": return make_form_data_source_filter( self.source_xform.data_node.tag_xmlns)
def get_case_data_source(app, case_type): prop_map = get_case_properties(app, [case_type], defaults=DEFAULT_CASE_PROPERTY_DATATYPES.keys()) return DataSourceConfiguration( domain=app.domain, referenced_doc_type="CommCareCase", table_id=_clean_table_name(app.domain, case_type), display_name=case_type, configured_filter=make_case_data_source_filter(case_type), configured_indicators=[make_case_property_indicator(property) for property in prop_map[case_type]], )
def get_case_data_source(app, case_type): prop_map = get_case_properties(app, [case_type], defaults=list(DEFAULT_CASE_PROPERTY_DATATYPES)) return DataSourceConfiguration( domain=app.domain, referenced_doc_type='CommCareCase', table_id=_clean_table_name(app.domain, case_type), display_name=case_type, configured_filter=make_case_data_source_filter(case_type), configured_indicators=[ make_case_property_indicator(property) for property in prop_map[case_type] ] )
def get_case_data_source(app, case_type): property_builder = ParentCasePropertyBuilder(app, DEFAULT_CASE_PROPERTY_DATATYPES.keys()) return DataSourceConfiguration( domain=app.domain, referenced_doc_type='CommCareCase', table_id=_clean_table_name(app.domain, case_type), display_name=case_type, configured_filter=make_case_data_source_filter(case_type), configured_indicators=[ make_case_property_indicator(property) for property in property_builder.get_properties(case_type) ] )