(cls, case_property_mapping, parent_types, app_id, app_version)
return schema
Generates the schema for the main Case tab on the export page
        Includes system export properties for the case.
Generates the schema for the main Case tab on the export page
        Includes system export properties for the case.
Generates the schema for the main Case tab on the export page Includes system export properties for the case .
def _generate_schema_from_case_property_mapping(cls, case_property_mapping, parent_types, app_id, app_version):
        """
        Generates the schema for the main Case tab on the export page
        Includes system export properties for the case.
        """
        assert len(list(case_property_mapping)) == 1
        schema = cls()

        group_schema = ExportGroupSchema(
            path=MAIN_TABLE,
            last_occurrences={app_id: app_version},
        )

        for case_type, case_properties in case_property_mapping.items():

            for prop in case_properties:
                group_schema.items.append(ScalarItem(
                    path=[PathNode(name=prop)],
                    label=prop,
                    last_occurrences={app_id: app_version},
                ))

        for case_type, identifier in parent_types:
            group_schema.items.append(CaseIndexItem(
                path=[PathNode(name='indices'), PathNode(name=case_type)],
                label='{}.{}'.format(identifier, case_type),
                last_occurrences={app_id: app_version},
                tag=PROPERTY_TAG_CASE,
            ))

        schema.group_schemas.append(group_schema)
        return schema
def _generate_schema_from_case_property_mapping ( cls , case_property_mapping , parent_types , app_id , app_version ) : assert len ( list ( case_property_mapping ) ) == 1 schema = cls ( ) group_schema = ExportGroupSchema ( path = MAIN_TABLE , last_occurrences = { app_id : app_version } , ) for case_type , case_properties in case_property_mapping . items ( ) : for prop in case_properties : group_schema . items . append ( ScalarItem ( path = [ PathNode ( name = prop ) ] , label = prop , last_occurrences = { app_id : app_version } , ) ) for case_type , identifier in parent_types : group_schema . items . append ( CaseIndexItem ( path = [ PathNode ( name = 'indices' ) , PathNode ( name = case_type ) ] , label = '{}.{}' . format ( identifier , case_type ) , last_occurrences = { app_id : app_version } , tag = PROPERTY_TAG_CASE , ) ) schema . group_schemas . append ( group_schema ) return schema