Bases: object
Common methods used in core and service plugins.
Register a hook to be invoked when a query is executed.
Add the hooks to the _model_query_hooks dict. Models are the keys of this dict, whereas the value is another dict mapping hook names to callables performing the hook. Each hook has a “query” component, used to build the query expression and a “filter” component, which is used to build the filter expression.
Query hooks take as input the query being built and return a transformed query expression.
Filter hooks take as input the filter expression being built and return a transformed filter expression
Return a weakref to the instance.
Minimize the potential for the instance persisting unnecessarily in memory by returning a weakref proxy that won’t prevent deallocation.