Add Flask.request_globals_class to customize g.

Requested by toothr on #pocoo.
This commit is contained in:
Ron DuPlain 2012-04-18 20:46:07 -04:00
parent 26da6a5365
commit 33bae1a8dc
4 changed files with 20 additions and 2 deletions

View file

@ -28,7 +28,7 @@ from .helpers import _PackageBoundObject, url_for, get_flashed_messages, \
find_package
from .wrappers import Request, Response
from .config import ConfigAttribute, Config
from .ctx import RequestContext, AppContext
from .ctx import RequestContext, AppContext, _RequestGlobals
from .globals import _request_ctx_stack, request
from .sessions import SecureCookieSessionInterface
from .module import blueprint_is_module
@ -148,6 +148,11 @@ class Flask(_PackageBoundObject):
#: :class:`~flask.Response` for more information.
response_class = Response
#: The class that is used for the :data:`~flask.g` instance.
#:
#: .. versionadded:: 0.9
request_globals_class = _RequestGlobals
#: The debug flag. Set this to `True` to enable debugging of the
#: application. In debug mode the debugger will kick in when an unhandled
#: exception ocurrs and the integrated server will automatically reload