EntityDependencyEventHandlerBase
- class app.portfolio.models.entity.dependency_event_handler.base.EntityDependencyEventHandlerBase[source]
Bases:
LoggableMixin
,Generic
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:
owner (T_Owner)
event (EntityDependencyEventType)
record (T_Record)
- 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:
cls (type[T])
source (type[T] | None)
kwargs (Unpack[GetConcreteParentArgumentKwargs])
- 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:
cls (type[T])
source (type[T] | None)
kwargs (Unpack[GetConcreteParentArgumentKwargs])
- Return type:
type[R]
- match_attributes(owner: T_Owner, record: T_Record, journal: Journal) frozenset[str] | None [source]
- match_entity(owner: T_Owner, event: EntityDependencyEventType, record: T_Record) bool [source]
- Parameters:
owner (T_Owner)
event (EntityDependencyEventType)
record (T_Record)
- Return type:
- match_event(event: EntityDependencyEventType) bool [source]
- Parameters:
event (EntityDependencyEventType)
- Return type: