(sender, domain, case_type, properties)
Adds inferred properties to the inferred schema for a case type.

    :param: sender - The signal sender
    :param: domain
    :param: case_type
    :param: properties - An iterable of case properties to add to the inferred schema
Adds inferred properties to the inferred schema for a case type.
Adds inferred properties to the inferred schema for a case type .
def _cached_add_inferred_export_properties(sender, domain, case_type, properties):
    from corehq.apps.export.models import MAIN_TABLE, PathNode, CaseInferredSchema, ScalarItem
    """
    Adds inferred properties to the inferred schema for a case type.

    :param: sender - The signal sender
    :param: domain
    :param: case_type
    :param: properties - An iterable of case properties to add to the inferred schema
    """

    assert domain, 'Must have domain'
    assert case_type, 'Must have case type'
    assert all(['.' not in prop for prop in properties]), 'Properties should not have periods'
    inferred_schema = get_case_inferred_schema(domain, case_type)
    if not inferred_schema:
        inferred_schema = CaseInferredSchema(
            domain=domain,
            case_type=case_type,
        )
    group_schema = inferred_schema.put_group_schema(MAIN_TABLE)
    add_properties_to_data_dictionary(domain, case_type, properties)

    for case_property in properties:
        path = [PathNode(name=case_property)]
        system_property_column = list(filter(
            lambda column: column.item.path == path and column.item.transform is None,
            MAIN_CASE_TABLE_PROPERTIES,
        ))

        if system_property_column:
            assert len(system_property_column) == 1
            column = system_property_column[0]
            group_schema.put_item(path, inferred_from=sender, item_cls=column.item.__class__)
        else:
            group_schema.put_item(path, inferred_from=sender, item_cls=ScalarItem)

    inferred_schema.save()
def _cached_add_inferred_export_properties ( sender , domain , case_type , properties ) : from corehq . apps . export . models import MAIN_TABLE , PathNode , CaseInferredSchema , ScalarItem assert domain , 'Must have domain' assert case_type , 'Must have case type' assert all ( [ '.' not in prop for prop in properties ] ) , 'Properties should not have periods' inferred_schema = get_case_inferred_schema ( domain , case_type ) if not inferred_schema : inferred_schema = CaseInferredSchema ( domain = domain , case_type = case_type , ) group_schema = inferred_schema . put_group_schema ( MAIN_TABLE ) add_properties_to_data_dictionary ( domain , case_type , properties ) for case_property in properties : path = [ PathNode ( name = case_property ) ] system_property_column = list ( filter ( lambda column : column . item . path == path and column . item . transform is None , MAIN_CASE_TABLE_PROPERTIES , ) ) if system_property_column : assert len ( system_property_column ) == 1 column = system_property_column [ 0 ] group_schema . put_item ( path , inferred_from = sender , item_cls = column . item . __class__ ) else : group_schema . put_item ( path , inferred_from = sender , item_cls = ScalarItem ) inferred_schema . save ( )