Field
No overview available.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | PyBackedStr | The identifier of the field used for mapping data during validation and serialization. |
| lookup_path_collection | [LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection) | A collection of paths used to locate the field's value within a source data structure. |
| validator | Arc< CombinedValidator > | The core validation logic used to enforce constraints and types on the field's input data. |
| frozen | bool | A flag indicating whether the field's value is immutable after the initial assignment. |
Constructor
Signature
def Field(
name: PyBackedStr,
lookup_path_collection: [LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection),
validator: Arc< CombinedValidator >,
frozen: bool
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| name | PyBackedStr | The name of the field. |
| lookup_path_collection | [LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection) | The collection of paths used for looking up the field value. |
| validator | Arc< CombinedValidator > | The validator used to validate the field's data. |
| frozen | bool | Indicates whether the field is immutable. |
Methods
name()
def name() - > PyBackedStr
The name of the field as defined in the schema.
Returns
| Type | Description |
|---|---|
PyBackedStr | The string identifier for the field. |
lookup_path_collection()
def lookup_path_collection() - > [LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection)
The collection of paths used to look up values for this field in the input data.
Returns
| Type | Description |
|---|---|
[LookupPathCollection](../../../lookup/key/lookuppathcollection.md?sid=lookup_key_lookuppathcollection) | A collection of lookup paths. |
validator()
def validator() - > Arc< CombinedValidator >
The validator used to validate and coerce the input data for this field.
Returns
| Type | Description |
|---|---|
Arc< CombinedValidator > | An atomic reference-counted pointer to the combined validator. |
frozen()
def frozen() - > bool
Indicates whether the field is frozen and cannot be modified after initialization.
Returns
| Type | Description |
|---|---|
bool | True if the field is immutable, False otherwise. |