Skip to content

Commit 52f9cef

Browse files
committed
More documentation updates for 0.9
1 parent 32f845e commit 52f9cef

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/extensiondev.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ So here's what these lines of code do:
224224
one.
225225
3. Next, we define a ``connect`` method that opens a database connection.
226226
4. Finally, we add a ``connection`` property that on first access opens
227-
the database connection and stores it on the context.
227+
the database connection and stores it on the context. This is also
228+
the recommended way to handling resources: fetch resources lazily the
229+
first time they are used.
228230

229231
Note here that we're attaching our database connection to the top
230232
application context via ``_app_ctx_stack.top``. Extensions should use

docs/upgrading.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ the old behavior, you can add it easily by subclassing Flask::
3434
return self.response_class(*rv)
3535
return Flask.make_response(self, rv)
3636

37+
If you have an extension that was using :data:`~flask._request_ctx_stack`
38+
before, please consider changing to :data:`~flask._app_ctx_stack` if it
39+
makes sense for your extension. This will for example be the case for
40+
extensions that connect to databases. This will allow your users to
41+
easier use your extension with more complex use cases outside of requests.
42+
3743
Version 0.8
3844
-----------
3945

0 commit comments

Comments
 (0)