pyramid.request
Request
context
The context
will be available as the context
attribute of the request
object. It will be the context object implied by the current request. See traversal_chapter
for information about context objects.
registry
The application registry
will be available as the registry
attribute of the request
object. See zca_chapter
for more information about the application registry.
root
The root
object will be available as the root
attribute of the request
object. It will be the resource object at which traversal started (the root). See traversal_chapter
for information about root objects.
subpath
The traversal subpath
will be available as the subpath
attribute of the request
object. It will be a sequence containing zero or more elements (which will be Unicode objects). See traversal_chapter
for information about the subpath.
traversed
The "traversal path" will be available as the traversed
attribute of the request
object. It will be a sequence representing the ordered set of names that were used to traverse to the context
, not including the view name or subpath. If there is a virtual root associated with the request, the virtual root path is included within the traversal path. See traversal_chapter
for more information.
view_name
The view name
will be available as the view_name
attribute of the request
object. It will be a single string (possibly the empty string if we're rendering a default view). See traversal_chapter
for information about view names.
virtual_root
The virtual root
will be available as the virtual_root
attribute of the request
object. It will be the virtual root object implied by the current request. See vhosting_chapter
for more information about virtual roots.
virtual_root_path
The virtual root
path will be available as the virtual_root_path
attribute of the request
object. It will be a sequence representing the ordered set of names that were used to traverse to the virtual root object. See vhosting_chapter
for more information about virtual roots.
exception
If an exception was raised by a root factory
or a view callable
, or at various other points where Pyramid
executes user-defined code during the processing of a request, the exception object which was caught will be available as the exception
attribute of the request within a exception view
, a response callback
or a finished callback
. If no exception occurred, the value of request.exception
will be None
within response and finished callbacks.
session
If a session factory
has been configured, this attribute will represent the current user's session
object. If a session factory has not been configured, requesting the request.session
attribute will cause a pyramid.exceptions.ConfigurationError
to be raised.
tmpl_context
The template context for Pylons-style applications.
matchdict
If a route
has matched during this request, this attribute will be a dictionary containing the values matched by the URL pattern associated with the route. If a route has not matched during this request, the value of this attribute will be None
. See matchdict
.
matched_route
If a route
has matched during this request, this attribute will be an obect representing the route matched by the URL pattern associated with the route. If a route has not matched during this request, the value of this attribute will be None
. See matched_route
.
add_response_callback
add_finished_callback
route_url
route_path
resource_url
static_url