Changed interface for flask.g

This now makes it behave like it did before, it's just an object.
It did however gain ``__contains__`` and ``__iter__`` and I added
a ``get()`` method to fetch an attribute without raising an
error.  This fixes #759.
This commit is contained in:
Armin Ronacher 2013-06-09 12:06:33 +01:00
parent efd6e468ae
commit c889fbc231
4 changed files with 29 additions and 19 deletions

View file

@ -40,6 +40,10 @@ Release date to be decided.
``flask.json.dumps`` to return bytestrings by default.
- ``flask.g`` is now stored on the app context instead of the request
context.
- ``flask.g`` now gained a ``get()`` method for not erroring out on non
existing items.
- ``flask.g`` now can be used with the ``in`` operator to see what's defined
and it now is iterable and will yield all attributes stored.
- ``flask.Flask.request_globals_class`` got renamed to
``flask.Flask.app_ctx_globals_class`` which is a better name to what it
does since 0.10.