Skip to main content

computed_field

No overview available.

def computed_field(
func: PropertyT
) - > PropertyT

A decorator used to mark a method or property as a computed field in a Pydantic model, allowing it to be included in the model's serialized output.

Parameters

NameTypeDescription
funcPropertyTThe function or property getter to be treated as a computed field.

Returns

TypeDescription
PropertyTThe decorated property or method, now registered as a computed field for serialization.