CaseInsensitiveMapping
Mapping allowing case-insensitive key lookups. Original case of keys is preserved for iteration and string representation.
Attributes
| Attribute | Type | Description |
|---|---|---|
| _store | dict | Internal dictionary mapping lowercase keys to tuples of the original key and its associated value to facilitate case-insensitive lookups while preserving original casing. |
Constructor
Signature
def CaseInsensitiveMapping(
data: [Union](../../contrib/gis/db/models/functions/union.md?sid=django_contrib_gis_db_models_functions_union)[dict, Mapping, Iterable[[Tuple](../../db/models/fields/tuple/lookups/tuple.md?sid=django_db_models_fields_tuple_lookups_tuple)[str, Any]]]
)
Parameters
| Name | Type | Description |
|---|---|---|
| data | [Union](../../contrib/gis/db/models/functions/union.md?sid=django_contrib_gis_db_models_functions_union)[dict, Mapping, Iterable[[Tuple](../../db/models/fields/tuple/lookups/tuple.md?sid=django_db_models_fields_tuple_lookups_tuple)[str, Any]]] | The initial data to populate the mapping, which can be a dictionary, another mapping, or an iterable of key-value pairs. |
Methods
copy()
@classmethod
def copy() - > [CaseInsensitiveMapping](caseinsensitivemapping.md?sid=django_utils_datastructures_caseinsensitivemapping)
Returns the mapping instance itself, as the object is intended to be treated as immutable.
Returns
| Type | Description |
|---|---|
[CaseInsensitiveMapping](caseinsensitivemapping.md?sid=django_utils_datastructures_caseinsensitivemapping) | The current instance of the mapping. |