EntityDependencyEventHandlerBase

class app.portfolio.models.entity.dependency_event_handler.base.EntityDependencyEventHandlerBase[source]

Bases: LoggableMixin, Generic

Inheritance diagram of EntityDependencyEventHandlerBase

Inheritance Diagram for EntityDependencyEventHandlerBase

Methods

call(owner, event, record, *[, ...])

get_owner_class(cls[, source])

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

get_record_class(cls[, source])

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

match_attribute(owner, record, attribute, value)

match_attributes(owner, record, journal)

match_entity(owner, event, record)

match_event(event)

register(owner)

Attributes

call(owner: T_Owner, event: EntityDependencyEventType, record: T_Record, *, matched_attributes: frozenset[str] | None = None) None[source]
Parameters:
Return type:

None

classmethod get_owner_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:
Return type:

type[R]

classmethod get_record_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:
Return type:

type[R]

match_attribute(owner: T_Owner, record: T_Record, attribute: str, value: Any) bool[source]
Parameters:
  • owner (T_Owner)

  • record (T_Record)

  • attribute (str)

  • value (Any)

Return type:

bool

match_attributes(owner: T_Owner, record: T_Record, journal: Journal) frozenset[str] | None[source]
Parameters:
  • owner (T_Owner)

  • record (T_Record)

  • journal (Journal)

Return type:

frozenset[str] | None

match_entity(owner: T_Owner, event: EntityDependencyEventType, record: T_Record) bool[source]
Parameters:
Return type:

bool

match_event(event: EntityDependencyEventType) bool[source]
Parameters:

event (EntityDependencyEventType)

Return type:

bool

register(owner: type[T_Owner]) None[source]
Parameters:

owner (type[T_Owner])

Return type:

None