EntityDependents

class app.portfolio.models.entity.entity_dependents.EntityDependents[source]

Bases: LoggableMixin, HierarchicalMixinMinimal, NamedMixinMinimal

Inheritance diagram of EntityDependents

Inheritance Diagram for EntityDependents

Methods

__init__(uid)

add_dependent(entity_or_uid)

by_entity(entity_or_record)

by_uid(uid)

get_dependent_uids(*[, use_journal])

on_delete_record(record)

on_init_record(record)

remove_dependent(entity_or_uid)

Attributes

PROPAGATE_INSTANCE_NAME_FROM_PARENT

dependent_uids

dependents

entity

entity_or_none

entity_uid

instance_name

instance_parent

Returns the parent entity of this instance, if it exists.

record

record_or_none

PROPAGATE_INSTANCE_NAME_FROM_PARENT: ClassVar[bool] = False
__init__(uid: Uid) None[source]
Parameters:

uid (Uid)

Return type:

None

add_dependent(entity_or_uid: Entity | EntityRecord | Uid) None[source]
Parameters:

entity_or_uid (Entity | EntityRecord | Uid)

Return type:

None

classmethod by_entity(entity_or_record: Entity | EntityRecord) EntityDependents | None[source]
Parameters:

entity_or_record (Entity | EntityRecord)

Return type:

EntityDependents | None

classmethod by_uid(uid: Uid) EntityDependents | None[source]
Parameters:

uid (Uid)

Return type:

EntityDependents | None

property dependent_uids: Iterable[Uid]
property dependents: Iterable[Entity]
property entity: Entity
property entity_or_none: Entity | None
property entity_uid: Uid
get_dependent_uids(*, use_journal: bool = False) Iterable[Uid][source]
Parameters:

use_journal (bool)

Return type:

Iterable[Uid]

property instance_name: str
property instance_parent: Entity | None

Returns the parent entity of this instance, if it exists.

If the entity does not exist in the entity store, returns None.

on_delete_record(record: EntityRecord) None[source]
Parameters:

record (EntityRecord)

Return type:

None

on_init_record(record: EntityRecord) None[source]
Parameters:

record (EntityRecord)

Return type:

None

property record: EntityRecord
property record_or_none: EntityRecord | None
remove_dependent(entity_or_uid: Entity | EntityRecord | Uid) None[source]
Parameters:

entity_or_uid (Entity | EntityRecord | Uid)

Return type:

None