Skip to content

modules/utility/pyarchinit_data_converter.py

Overview

This file contains 5 documented elements.

Functions

convert_empty_to_none(value, field_type)

Convert empty strings to None for database fields

Args: value: The value to convert field_type: The expected field type ('text', 'integer', 'bigint', 'numeric', 'float')

Returns: Converted value suitable for database insertion

Parameters: - value - field_type

prepare_inventario_materiali_data(data_record)

Prepare inventario_materiali data for insertion Converts empty strings to None for numeric fields

Parameters: - data_record

prepare_thesaurus_data(data_record)

Prepare thesaurus data for insertion Converts empty strings to None/0 for numeric fields

Parameters: - data_record

prepare_tma_data(data_record)

Prepare TMA data for insertion Handles both tma_materiali_archeologici and ripetibili tables

Parameters: - data_record