EntityRoot
- class app.portfolio.models.root.entity_root.EntityRoot[source]
Bases:
LoggableHierarchicalRootModel
,Generic
Inheritance Diagram for EntityRoot
Methods
get_entity_type
(cls[, source])Resolve and cache the concrete parent argument defined by the descriptor.
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)Attributes
Configuration for the model, should be a dictionary conforming to
ConfigDict
.- 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:
cls (type[T])
source (type[T] | None)
kwargs (Unpack[GetConcreteParentArgumentKwargs])
- Return type:
type[R]
- static get_global_root() EntityRoot [source]
- Return type:
- static get_global_root_or_none() EntityRoot | None [source]
- Return type:
EntityRoot | None
- 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
.
- root: Annotated[Entity, InstanceOf()] | None
- session_manager: Annotated[SessionManager, InstanceOf()]