Exemple #1
0
def transform_xform_for_report_forms_index(doc_dict):
    doc_ret = transform_xform_for_elasticsearch(doc_dict)
    convert_property_dict(
        doc_ret['form'],
        REPORT_XFORM_INDEX_INFO.mapping['properties']['form'],
        override_root_keys=['case'])
    if 'computed_' in doc_ret:
        convert_property_dict(doc_ret['computed_'], {})

    return doc_ret
Exemple #2
0
def transform_xform_for_report_forms_index(doc_dict):
    doc_ret = transform_xform_for_elasticsearch(doc_dict)
    convert_property_dict(
        doc_ret['form'],
        REPORT_XFORM_INDEX_INFO.mapping['properties']['form'],
        override_root_keys=['case']
    )
    if 'computed_' in doc_ret:
        convert_property_dict(doc_ret['computed_'], {})

    return doc_ret
Exemple #3
0
    def change_transform(self, doc_dict):
        doc_ret = super(ReportXFormPillow, self).change_transform(doc_dict, include_props=False)

        if doc_ret:
            domain = self.get_domain(doc_dict)

            if domain not in getattr(settings, 'ES_XFORM_FULL_INDEX_DOMAINS', []):
                #full indexing is only enabled for select domains on an opt-in basis
                return None
            convert_property_dict(doc_ret['form'], self.default_mapping['properties']['form'], override_root_keys=['case'])
            if 'computed_' in doc_ret:
                convert_property_dict(doc_ret['computed_'], {})

            return doc_ret
        else:
            return None
Exemple #4
0
    def change_transform(self, doc_dict):
        doc_ret = super(ReportXFormPillow, self).change_transform(doc_dict, include_props=False)

        if doc_ret:
            domain = self.get_domain(doc_dict)

            if domain not in getattr(settings, 'ES_XFORM_FULL_INDEX_DOMAINS', []):
                # full indexing is only enabled for select domains on an opt-in basis
                return None
            convert_property_dict(doc_ret['form'], self.default_mapping['properties']['form'], override_root_keys=['case'])
            if 'computed_' in doc_ret:
                convert_property_dict(doc_ret['computed_'], {})

            return doc_ret
        else:
            return None