Request¶
Adding request methods¶
-
Application.add_request_attribute(attr, name=None, decorator=None, reify=False)[source]¶ Add dynamic attribute to requests.
This is mainly intended so that extensions can easily add request methods and properties.
Functions can already be decorated, or a
decoratorcan be specified. IfreifyisTrue, the function will be decorated withtangled.decorators.cached_property(). If adecoratoris passed andreifyisTrue,cached_propertywill be applied as the outermost decorator.
Request factories¶
These two methods make it easy to create properly configured requests. In
particular, they set the request’s app attribute, and they create
request instances with the attributes added via
tangled.web.app.Application.add_request_attribute().