Skip to content

Commit

Permalink
Document example request_globals_class use cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
rduplain committed Apr 24, 2012
1 parent 33bae1a commit e78e2a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flask/app.py
Expand Up @@ -150,6 +150,13 @@ class Flask(_PackageBoundObject):

#: The class that is used for the :data:`~flask.g` instance.
#:
#: Example use cases for a custom class:
#:
#: 1. Store arbitrary attributes on flask.g.
#: 2. Add a property for lazy per-request database connectors.
#: 3. Return None instead of AttributeError on expected attributes.
#: 4. Raise exception if an unexpected attr is set, a "controlled" flask.g.
#:
#: .. versionadded:: 0.9
request_globals_class = _RequestGlobals

Expand Down

0 comments on commit e78e2a1

Please sign in to comment.