pyramid.registry¶
-
class
Registry(name='', bases=())[source]¶ A registry object is an application registry. It is used by the framework itself to perform mappings of URLs to view callables, as well as servicing other various framework duties. A registry has its own internal API, but this API is rarely used by Pyramid application developers (it’s usually only used by developers of the Pyramid framework). But it has a number of attributes that may be useful to application developers within application code, such as
settings, which is a dictionary containing application deployment settings.For information about the purpose and usage of the application registry, see Pyramid で Zope コンポーネントアーキテクチャを使う.
The application registry is usually accessed as
request.registryin application code.-
settings¶ The dictionary-like deployment settings object. See Deployment Settings for information. This object is often accessed as
request.registry.settingsorconfig.registry.settingsin a typical Pyramid application.
-
introspector¶ When a registry is set up (or created) by a Configurator, the registry will be decorated with an instance named
introspectorimplementing thepyramid.interfaces.IIntrospectorinterface. See alsopyramid.config.Configurator.introspector.When a registry is created “by hand”, however, this attribute will not exist until set up by a configurator.
This attribute is often accessed as
request.registry.introspectorin a typical Pyramid application.This attribute is new as of Pyramid 1.3.
-
-
class
Introspectable[source]¶ The default implementation of the interface
pyramid.interfaces.IIntrospectableused by framework exenders. An instance of this class is created whenpyramid.config.Configurator.introspectableis called.This class is new as of Pyramid 1.3.
-
class
Deferred(func)[source]¶ Can be used by a third-party configuration extender to wrap a discriminator during configuration if an immediately hashable discriminator cannot be computed because it relies on unresolved values. The function should accept no arguments and should return a hashable discriminator.
This class is new as of Pyramid 1.4.
-
undefer(v)[source]¶ Function which accepts an object and returns it unless it is a
pyramid.registry.Deferredinstance. If it is an instance of that class, itsresolvemethod is called, and the result of the method is returned.This function is new as of Pyramid 1.4.