(self, row)
return fields_to_update
Returns a dict map of fields that were marked to be updated
        due to the import. This can be then used to pass to the CaseBlock
        to trigger updates.
Returns a dict map of fields that were marked to be updated
        due to the import. This can be then used to pass to the CaseBlock
        to trigger updates.
Returns a dict map of fields that were marked to be updated due to the import . This can be then used to pass to the CaseBlock to trigger updates .
def _populate_updated_fields(self, row):
        """
        Returns a dict map of fields that were marked to be updated
        due to the import. This can be then used to pass to the CaseBlock
        to trigger updates.
        """
        field_map = self.field_map
        fields_to_update = {}
        errors = []
        for key in field_map:
            try:
                update_value = row[key]
            except Exception:
                continue

            if 'field_name' in field_map[key]:
                update_field_name = field_map[key]['field_name'].strip()
            else:
                # nothing was selected so don't add this value
                continue

            if update_field_name in RESERVED_FIELDS:
                if update_field_name == 'parent_ref':
                    raise exceptions.InvalidCustomFieldNameException(
                        _('Field name "{}" is deprecated. Please use "parent_identifier" instead.'))
                else:
                    raise exceptions.InvalidCustomFieldNameException(
                        _('Field name "{}" is reserved').format(update_field_name))

            if isinstance(update_value, str) and update_value.strip() == SCALAR_NEVER_WAS:
                # If we find any instances of blanks ('---'), convert them to an
                # actual blank value without performing any data type validation.
                # This is to be consistent with how the case export works.
                update_value = ''
            elif update_value is not None:
                update_value = _convert_field_value(update_value)

            if update_field_name in self.fields_to_validate:
                case_property = self.fields_to_validate[update_field_name]
                try:
                    case_property.check_validity(update_value)
                except exceptions.CaseRowError as error:
                    error.column_name = update_field_name
                    errors.append(error)

            fields_to_update[update_field_name] = update_value

        if errors:
            raise exceptions.CaseRowErrorList(errors)

        return fields_to_update
def _populate_updated_fields ( self , row ) : field_map = self . field_map fields_to_update = { } errors = [ ] for key in field_map : try : update_value = row [ key ] except Exception : continue if 'field_name' in field_map [ key ] : update_field_name = field_map [ key ] [ 'field_name' ] . strip ( ) else : # nothing was selected so don't add this value continue if update_field_name in RESERVED_FIELDS : if update_field_name == 'parent_ref' : raise exceptions . InvalidCustomFieldNameException ( _ ( 'Field name "{}" is deprecated. Please use "parent_identifier" instead.' ) ) else : raise exceptions . InvalidCustomFieldNameException ( _ ( 'Field name "{}" is reserved' ) . format ( update_field_name ) ) if isinstance ( update_value , str ) and update_value . strip ( ) == SCALAR_NEVER_WAS : # If we find any instances of blanks ('---'), convert them to an # actual blank value without performing any data type validation. # This is to be consistent with how the case export works. update_value = '' elif update_value is not None : update_value = _convert_field_value ( update_value ) if update_field_name in self . fields_to_validate : case_property = self . fields_to_validate [ update_field_name ] try : case_property . check_validity ( update_value ) except exceptions . CaseRowError as error : error . column_name = update_field_name errors . append ( error ) fields_to_update [ update_field_name ] = update_value if errors : raise exceptions . CaseRowErrorList ( errors ) return fields_to_update