core.orm.observer ================= .. py:module:: core.orm.observer Attributes ---------- .. autoapisummary:: core.orm.observer._F core.orm.observer.MISSING Classes ------- .. autoapisummary:: core.orm.observer.ScopedPropertyObserver Functions --------- .. autoapisummary:: core.orm.observer.observes Module Contents --------------- .. py:data:: _F .. py:data:: MISSING .. py:class:: ScopedPropertyObserver(dotted_name: str | None) Bases: :py:obj:`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. .. py:attribute:: _global_observer :type: ClassVar[ScopedPropertyObserver] .. py:attribute:: _scoped_observers :type: ClassVar[dict[str, ScopedPropertyObserver]] .. py:attribute:: dotted_name .. py:property:: scope :type: type[object] .. py:method:: register_listeners() -> None .. py:method:: activate() -> None .. py:method:: deactivate() -> None .. py:method:: update_generator_registry(mapper: sqlalchemy.orm.Mapper, class_: type[Any]) -> None Adds generator functions to generator_registry. .. py:method:: enter_scope(application: onegov.core.framework.Framework) -> None :classmethod: .. py:method:: enter_class_scope(application_cls: type[onegov.core.framework.Framework]) -> None :classmethod: .. py:method:: __repr__() -> str .. py:function:: observes(*paths: str, scope: str | None = None) -> collections.abc.Callable[[_F], _F]