bundle.testing.tools.references.entity ====================================== .. py:module:: bundle.testing.tools.references.entity Attributes ---------- .. autoapisummary:: bundle.testing.tools.references.entity.JSON_ENCODERS bundle.testing.tools.references.entity.NAMESPACE bundle.testing.tools.references.entity.UNIQUE_GENERATOR_ACTIVE Classes ------- .. autoapisummary:: bundle.testing.tools.references.entity.TestEntity bundle.testing.tools.references.entity.NestedModel bundle.testing.tools.references.entity.RecursiveModel bundle.testing.tools.references.entity.TestComplexEntity bundle.testing.tools.references.entity.TestComplexEntityMultipleInheritance Module Contents --------------- .. py:data:: JSON_ENCODERS .. py:data:: NAMESPACE .. py:data:: UNIQUE_GENERATOR_ACTIVE :value: True .. py:class:: TestEntity(/, **data: Any) Bases: :py:obj:`bundle.core.Entity` An extension of the `Data` model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity's creation time and can automatically save its state upon destruction if configured to do so. .. attribute:: name The name of the entity, with a default value of "Default". :type: str .. attribute:: born_time The timestamp of entity instantiation, in nanoseconds. :type: int Properties: class_name (str): The name of the entity's class. age (int): The age of the entity in nanoseconds, calculated from its `born_time`. .. py:attribute:: born_time :type: int :value: None .. py:attribute:: identifier :type: bundle.core.entity.Identifier :value: None .. py:attribute:: version :type: str :value: None .. py:class:: NestedModel(/, **data: Any) Bases: :py:obj:`TestEntity` An extension of the `Data` model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity's creation time and can automatically save its state upon destruction if configured to do so. .. attribute:: name The name of the entity, with a default value of "Default". :type: str .. attribute:: born_time The timestamp of entity instantiation, in nanoseconds. :type: int Properties: class_name (str): The name of the entity's class. age (int): The age of the entity in nanoseconds, calculated from its `born_time`. .. py:attribute:: id :type: int :value: None .. py:attribute:: info :type: str :value: None .. py:attribute:: timestamp :type: datetime.datetime :value: None .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: RecursiveModel(/, **data: Any) Bases: :py:obj:`TestEntity` An extension of the `Data` model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity's creation time and can automatically save its state upon destruction if configured to do so. .. attribute:: name The name of the entity, with a default value of "Default". :type: str .. attribute:: born_time The timestamp of entity instantiation, in nanoseconds. :type: int Properties: class_name (str): The name of the entity's class. age (int): The age of the entity in nanoseconds, calculated from its `born_time`. .. py:attribute:: children :type: None | list[RecursiveModel] :value: None .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: TestComplexEntity(/, **data: Any) Bases: :py:obj:`TestEntity` An extension of the `Data` model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity's creation time and can automatically save its state upon destruction if configured to do so. .. attribute:: name The name of the entity, with a default value of "Default". :type: str .. attribute:: born_time The timestamp of entity instantiation, in nanoseconds. :type: int Properties: class_name (str): The name of the entity's class. age (int): The age of the entity in nanoseconds, calculated from its `born_time`. .. py:attribute:: string_field :type: str :value: None .. py:attribute:: int_field :type: int :value: None .. py:attribute:: float_field :type: float :value: None .. py:attribute:: bool_field :type: bool :value: None .. py:attribute:: optional_field :type: None | str :value: None .. py:attribute:: list_field :type: list[int] :value: None .. py:attribute:: set_field :type: set[str] :value: None .. py:attribute:: dict_field :type: dict[str, int] :value: None .. py:attribute:: dict_complex_field :type: dict[str, pathlib.Path] :value: None .. py:attribute:: union_field :type: int | str :value: None .. py:attribute:: nested_model :type: NestedModel :value: None .. py:attribute:: nested_model_list :type: list[NestedModel] :value: None .. py:attribute:: optional_nested_model :type: None | NestedModel :value: None .. py:attribute:: recursive_model :type: RecursiveModel :value: None .. py:attribute:: dynamic_default_field :type: str :value: None .. py:attribute:: file_path :type: pathlib.Path :value: None .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:method:: check_positive(value) .. py:method:: check_dynamic_default_based_on_int_field() .. py:class:: TestComplexEntityMultipleInheritance(/, **data: Any) Bases: :py:obj:`RecursiveModel`, :py:obj:`bundle.testing.tools.references.data.TestComplexData` An extension of the `Data` model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity's creation time and can automatically save its state upon destruction if configured to do so. .. attribute:: name The name of the entity, with a default value of "Default". :type: str .. attribute:: born_time The timestamp of entity instantiation, in nanoseconds. :type: int Properties: class_name (str): The name of the entity's class. age (int): The age of the entity in nanoseconds, calculated from its `born_time`. .. py:attribute:: born_time :type: int :value: None