Made grammar changes to the Tutorial.

This commit is contained in:
Matthew Rankin 2010-12-30 09:00:56 -06:00
parent 8421c1ea0c
commit 86cc6f9806
10 changed files with 63 additions and 64 deletions

View file

@ -3,9 +3,9 @@
Step 4: Request Database Connections
------------------------------------
Now we know how we can open database connections and use them for scripts,
Now we know how to open database connections and use them for scripts,
but how can we elegantly do that for requests? We will need the database
connection in all our functions so it makes sense to initialize them
connection in all our functions, so it makes sense to initialize them
before each request and shut them down afterwards.
Flask allows us to do that with the :meth:`~flask.Flask.before_request` and
@ -27,10 +27,10 @@ passed the response that will be sent to the client. They have to return
that response object or a different one. In this case we just return it
unchanged.
We store our current database connection on the special :data:`~flask.g`
object that flask provides for us. This object stores information for one
We store our current database connection in the special :data:`~flask.g`
object that Flask provides for us. This object stores information for one
request only and is available from within each function. Never store such
things on other objects because this would not work with threaded
things in other objects because this would not work with threaded
environments. That special :data:`~flask.g` object does some magic behind
the scenes to ensure it does the right thing.