(
cls,
class_: Union[DeclarativeAttributeIntercept, DeclarativeMeta, type],
subject: Union[ClassManager[_O], Mapper[_O]],
)
| 683 | |
| 684 | @classmethod |
| 685 | def populate( |
| 686 | cls, |
| 687 | class_: Union[DeclarativeAttributeIntercept, DeclarativeMeta, type], |
| 688 | subject: Union[ClassManager[_O], Mapper[_O]], |
| 689 | ) -> None: |
| 690 | for subclass in class_.__mro__: |
| 691 | if subclass in cls.all_holds: |
| 692 | collection = cls.all_holds[subclass] |
| 693 | for ( |
| 694 | event_key, |
| 695 | raw, |
| 696 | propagate, |
| 697 | retval, |
| 698 | kw, |
| 699 | ) in collection.values(): |
| 700 | if propagate or subclass is class_: |
| 701 | # since we can't be sure in what order different |
| 702 | # classes in a hierarchy are triggered with |
| 703 | # populate(), we rely upon _EventsHold for all event |
| 704 | # assignment, instead of using the generic propagate |
| 705 | # flag. |
| 706 | event_key.with_dispatch_target(subject).listen( |
| 707 | raw=raw, propagate=False, retval=retval, **kw |
| 708 | ) |
| 709 | |
| 710 | |
| 711 | class _InstanceEventsHold(_EventsHold[_ET]): |
no test coverage detected