EntityRoot

class app.portfolio.models.root.entity_root.EntityRoot[source]

Bases: LoggableHierarchicalRootModel, Generic

Inheritance diagram of EntityRoot

Inheritance Diagram for EntityRoot

Methods

clear_global_root()

create_global_root()

create_root_entity()

get_entity_type(cls[, source])

Resolve and cache the concrete parent argument defined by the descriptor.

get_global_root()

get_global_root_or_none()

get_or_create_global_root()

model_post_init(context)

on_session_abort(session)

on_session_apply(session)

on_session_commit(session)

on_session_end(session)

on_session_notify(session)

on_session_start(session)

set_as_global_root()

Attributes

entity

model_config

Configuration for the model, should be a dictionary conforming to ConfigDict.

root

session_manager

entity_store

static clear_global_root() None[source]
Return type:

None

classmethod create_global_root() T[source]
Return type:

T

create_root_entity() E[source]
Return type:

E

property entity: E
entity_store: Annotated[EntityStore, InstanceOf()]
classmethod get_entity_type(cls: type[T], source: type[T] | None = None, **kwargs: Unpack[GetConcreteParentArgumentKwargs]) type[R]

Resolve and cache the concrete parent argument defined by the descriptor.

The descriptor caches the result per owning class via instance_lru_cache() so repeated introspections remain constant time.

Raises:

GenericsError – If the underlying parent argument cannot be resolved to a concrete type.

Parameters:
Return type:

type[R]

static get_global_root() EntityRoot[source]
Return type:

EntityRoot

static get_global_root_or_none() EntityRoot | None[source]
Return type:

EntityRoot | None

classmethod get_or_create_global_root() T[source]
Return type:

T

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': False, 'serialize_by_alias': True, 'validate_assignment': True, 'validate_by_alias': True}

Configuration for the model, should be a dictionary conforming to ConfigDict.

model_post_init(context: Any) None
Parameters:

context (Any)

Return type:

None

on_session_abort(session: Session) None[source]
Parameters:

session (Session)

Return type:

None

on_session_apply(session: Session) None[source]
Parameters:

session (Session)

Return type:

None

on_session_commit(session: Session) None[source]
Parameters:

session (Session)

Return type:

None

on_session_end(session: Session) None[source]
Parameters:

session (Session)

Return type:

None

on_session_notify(session: Session) None[source]
Parameters:

session (Session)

Return type:

None

on_session_start(session: Session) None[source]
Parameters:

session (Session)

Return type:

None

root: Annotated[Entity, InstanceOf()] | None
session_manager: Annotated[SessionManager, InstanceOf()]
set_as_global_root() None[source]
Return type:

None