EntityBase
- class app.portfolio.models.entity.entity_base.EntityBase[source]
Bases:
CachedTypeHintsMixin
,LoggableHierarchicalModel
,NamedMixinMinimal
,Generic
Inheritance Diagram for EntityBase
Methods
__init__
(**data)by_record
(record)by_uid
(uid)by_uid_or_none
(uid)calculate_instance_name_from_instance
(instance)call_record_method
(name, *args, **kwargs)delete
()get_record_type
(cls[, source])Resolve and cache the concrete parent argument defined by the descriptor.
is_reachable
(*[, recursive, use_journal])model_post_init
(context)narrow_to_instance
(value)narrow_to_instance_or_none
(value)narrow_to_uid
(value)on_init_record
(record)revert
()sort_key
()Return the namespace for the UID.
update
(**kwargs)Attributes
Configuration for the model, should be a dictionary conforming to
ConfigDict
.instance_parent_weakref
- classmethod by_record(record: EntityRecord) Self [source]
- Parameters:
record (EntityRecord)
- Return type:
- classmethod calculate_instance_name_from_instance(instance: EntityBase) str [source]
- Parameters:
instance (EntityBase)
- Return type:
- property children: Iterable[EntityBase]
- entity_dependents: EntityDependents
- classmethod get_record_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]
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'serialize_by_alias': True, 'validate_assignment': True, 'validate_by_alias': True}
Configuration for the model, should be a dictionary conforming to
ConfigDict
.
- property record: T_Record
- property session_manager: SessionManager
- property session_manager_or_none: SessionManager | None