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 decorator can be specified. If reify is True, the function will be decorated with tangled.decorators.cached_property(). If a decorator is passed and reify is True, cached_property will 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

Application.make_request(environ, **kwargs)[source]

Make a request using the registered request factory.

Application.make_blank_request(*args, **kwargs)[source]

Make a blank request using the registered request factory.