EntityRecordBase
- class app.portfolio.models.entity.entity_record_base.EntityRecordBase[source]
Bases:
EntityRecordMeta
,CachedTypeHintsMixin
,LoggableHierarchicalRootModel
,EntityImpl
,EntitySchema
,NamedMixinMinimal
,Generic
Inheritance Diagram for EntityRecordBase
Methods
apply_deletion
(*[, who, why])by_uid
(uid)by_uid_or_none
(uid)call_entity_method
(name, *args, **kwargs)delete
()get_children_uids
(*[, use_journal])get_journal
(*[, create, fail])get_journal_class
(cls[, source])Resolve and cache the concrete parent argument defined by the descriptor.
get_journal_field
(field, *[, create])is_computed_field
(field)is_journal_field_edited
(field)is_model_field
(field)is_model_field_alias
(alias)is_newer_version_than
(other)is_protected_field_type
(field)is_reachable
(*[, recursive, use_journal])is_update_allowed
(*[, in_commit_only, ...])iter_children_uids
(*[, use_journal])iter_hierarchy
(*[, condition, use_journal, ...])Return a flat ordered set of all entities in this hierarchy.
model_post_init
(context)narrow_to_instance
(value)narrow_to_instance_or_none
(value)narrow_to_uid
(value)on_annotation_record_created
(annotation_or_uid)on_annotation_record_deleted
(annotation_or_uid)on_dependency_deleted
(source)on_dependency_updated
(source)register_entity_class
(entity_class)resolve_field_alias
(alias)reverse_field_alias
(name)revert
()sort_key
()update
(**kwargs)Create a new instance of the entity record with the updated data.
Attributes
Get the instance name, or class name if not set.
Configuration for the model, should be a dictionary conforming to
ConfigDict
.Indicates whether this entity record instance has been superseded by another instance with an incremented version.
- property children: Iterable[EntityRecordBase]
- property dependents: Iterable[EntityRecordBase]
- property entity_dependents: EntityDependents
- property extra_dependencies: UidProxySet[__annotationlib_name_1__]
- classmethod get_journal_class(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]
- property instance_parent: HierarchicalProtocol | NamedProtocol | None
- is_newer_version_than(other: EntityRecordBase) bool [source]
- Parameters:
other (EntityRecordBase)
- Return type:
- classmethod is_update_allowed(*, in_commit_only: bool = True, allow_in_abort: bool = False, force_session: bool = False) bool [source]
- classmethod iter_dependency_event_handlers() Iterable[EntityDependencyEventHandlerBase] [source]
- Return type:
- iter_hierarchy(*, condition: Callable[[EntityRecordBase], bool] | None = None, use_journal: bool = False, check_condition_on_return: bool = True) Iterable[EntityRecordBase] [source]
Return a flat ordered set of all entities in this hierarchy.
- Parameters:
condition (Callable[[EntityRecordBase], bool] | None)
use_journal (bool)
check_condition_on_return (bool)
- Return type:
- property j: T_Journal
- property journal: T_Journal
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'serialize_by_alias': True, 'validate_assignment': True, 'validate_by_alias': True}
Configuration for the model, should be a dictionary conforming to
ConfigDict
.
- classmethod narrow_to_instance(value: T | Uid) T [source]
- Parameters:
value (T | Uid)
- Return type:
T
- classmethod narrow_to_instance_or_none(value: T | Uid) T | None [source]
- Parameters:
value (T | Uid)
- Return type:
T | None
- on_annotation_record_created(annotation_or_uid: AnnotationRecord | __annotationlib_name_1__) None [source]
- Parameters:
annotation_or_uid (AnnotationRecord | __annotationlib_name_1__)
- Return type:
None
- on_annotation_record_deleted(annotation_or_uid: AnnotationRecord | __annotationlib_name_1__) None [source]
- Parameters:
annotation_or_uid (AnnotationRecord | __annotationlib_name_1__)
- Return type:
None
- on_dependency_deleted(source: Journal) None [source]
- Parameters:
source (Journal)
- Return type:
None
- on_dependency_updated(source: Journal) None [source]
- Parameters:
source (Journal)
- Return type:
None
- property record_parent: EntityRecordBase
- property record_parent_or_none: EntityRecordBase | None
- classmethod register_dependency_event_handler(record: EntityDependencyEventHandlerBase) None [source]
- Parameters:
record (EntityDependencyEventHandlerBase)
- Return type:
None
- property session_manager: SessionManager
- property session_manager_or_none: SessionManager | None
- property superseded: bool
Indicates whether this entity record instance has been superseded by another instance with an incremented version.
- property superseding: T