core.orm.observer

Module Contents

Classes

ScopedPropertyObserver

This subclass of PropertyObserver doesn't register itself globally.

Functions

observes(→ Callable[[_F], _F])

Attributes

_F

MISSING

core.orm.observer._F[source]
core.orm.observer.MISSING[source]
class core.orm.observer.ScopedPropertyObserver(dotted_name: str | None)[source]

Bases: sqlalchemy_utils.observer.PropertyObserver

This subclass of PropertyObserver doesn’t register itself globally.

Having all observers listen for each application is both wasteful and can lead to bugs if some tables only exist for some applications.

We should never use the base class, since that will always cause all observers to trigger regardless of whether we used the scoped observer or not.

property scope: type[object][source]
_global_observer: ClassVar[ScopedPropertyObserver][source]
_scoped_observers: ClassVar[dict[str, ScopedPropertyObserver]][source]
_scoped_observers[source]
register_listeners() None[source]
activate() None[source]
deactivate() None[source]
update_generator_registry(mapper: sqlalchemy.orm.Mapper, class_: type[Any]) None[source]

Adds generator functions to generator_registry.

classmethod enter_scope(application: onegov.core.framework.Framework) None[source]
__repr__() str[source]

Return repr(self).

core.orm.observer.observes(*paths: str, scope: str | None = None) Callable[[_F], _F][source]