Skip to content

Commit

Permalink
More documentation updates for 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Apr 9, 2012
1 parent 32f845e commit 52f9cef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/extensiondev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ So here's what these lines of code do:
one.
3. Next, we define a ``connect`` method that opens a database connection.
4. Finally, we add a ``connection`` property that on first access opens
the database connection and stores it on the context.
the database connection and stores it on the context. This is also
the recommended way to handling resources: fetch resources lazily the
first time they are used.

Note here that we're attaching our database connection to the top
application context via ``_app_ctx_stack.top``. Extensions should use
Expand Down
6 changes: 6 additions & 0 deletions docs/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ the old behavior, you can add it easily by subclassing Flask::
return self.response_class(*rv)
return Flask.make_response(self, rv)

If you have an extension that was using :data:`~flask._request_ctx_stack`
before, please consider changing to :data:`~flask._app_ctx_stack` if it
makes sense for your extension. This will for example be the case for
extensions that connect to databases. This will allow your users to
easier use your extension with more complex use cases outside of requests.

Version 0.8
-----------

Expand Down

0 comments on commit 52f9cef

Please sign in to comment.