zope.component.hooks: The current component registry¶
zope.component.hooks: The current component registry for narrative documentation and examples.
Hooks for getting and setting a site in the thread global namespace.
site(site) → None
Context manager that sets site as the current site for the duration of the
A special hook for getting the site manager.
Here we take the currently set site into account to find the appropriate site manager.
zope.component.getSiteManagerand interface adaptation respect the current site.
Most applications will want to be sure te call this early in their startup sequence. Test code that uses these APIs should also arrange to call this.
zope.component.getSiteManagerand interface adaptation to their original implementations that are unaware of the current site.
Use caution when calling this; most code will not need to call this. If code using the global API executes following this, it will most likely use the base global component registry instead of a site-specific registry it was expected. This can lead to failures in adaptation and utility lookup.