core.orm.observer

Attributes

_F

MISSING

Classes

ScopedPropertyObserver

This subclass of PropertyObserver doesn't register itself globally.

Functions

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

Module Contents

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.

_global_observer: ClassVar[ScopedPropertyObserver][source]
_scoped_observers: ClassVar[dict[str, ScopedPropertyObserver]][source]
dotted_name[source]
property scope: type[object][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]
classmethod enter_class_scope(application_cls: type[onegov.core.framework.Framework]) None[source]
__repr__() str[source]
core.orm.observer.observes(*paths: str, scope: str | None = None) Callable[[_F], _F][source]