@@ -28,8 +28,8 @@ or alternatively if you have pip installed::
2828How to Use
2929----------
3030
31- Flask-SQLAlchemy is fun to use, and for the basic applications also
32- incredible easy. For the complete guide, checkout out the API
31+ Flask-SQLAlchemy is fun to use, and incredibly easy for basic applications.
32+ For the complete guide, checkout out the API
3333documentation on the :class: `SQLAlchemy ` class.
3434
3535Basically all you have to do is to create an :class: `SQLAlchemy ` object
@@ -61,7 +61,7 @@ and use this to declare models. Here a complete example::
6161 def __repr__(self):
6262 return '<User %r>' % self.username
6363
64- So how to create that database, just import the `db ` object from your
64+ To create the initial database, just import the `db ` object from a
6565interactive Python shell and run the :meth: `~SQLAlchemy.create_all ` method
6666to create the tables and database:
6767
@@ -74,7 +74,7 @@ Boom, and there is your database. Now to create some users:
7474>>> admin = User(' admin' , ' open sesame' )
7575>>> guest = User(' guest' , ' i-shall-pass' )
7676
77- But they are still not in the database, so let's make sure they are:
77+ But they are not yet in the database, so let's make sure they are:
7878
7979>>> db.session.add(admin)
8080>>> db.session.add(guest)
@@ -90,17 +90,16 @@ And how do you get the data back? Easy as pie:
9090Road to Enlightenment
9191---------------------
9292
93- All you need to know compared to plain SQLAlchemy is this :
93+ The only things you need to know compared to plain SQLAlchemy are :
9494
95951. :class: `SQLAlchemy ` gives you access to the following things:
9696
9797 - all the functions and classes from :mod: `sqlalchemy ` and
9898 :mod: `sqlalchemy.orm `
9999 - a preconfigured scoped session called `session `
100100 - the `metadata `
101- - as well as a :meth: `SQLAlchemy.create_all ` and
102- :meth: `SQLAlchemy.drop_all ` methods to create and drop
103- tables according to the models.
101+ - a :meth: `SQLAlchemy.create_all ` and :meth: `SQLAlchemy.drop_all `
102+ methods to create and drop tables according to the models.
104103 - a :class: `Model ` baseclass that is a configured declarative base.
105104
1061052. The :class: `Model ` declarative base class behaves like a regular
@@ -121,7 +120,7 @@ The following configuration values exist for Flask-SQLAlchemy:
121120.. tabularcolumns :: |p{6.5cm}|p{8.5cm}|
122121
123122=============================== =========================================
124- ``SQLALCHEMY_DATABASE_URI `` the database URI that should be used for
123+ ``SQLALCHEMY_DATABASE_URI `` The database URI that should be used for
125124 the connection. Examples:
126125
127126 - ``sqlite:////tmp/test.db ``
@@ -139,14 +138,14 @@ The following configuration values exist for Flask-SQLAlchemy:
139138 some database adapters like postgres when
140139 used with inproper database defaults that
141140 specify encoding-less databases (like
142- postgres on some ubuntu versions)
143- ``SQLALCHEMY_POOL_SIZE `` the size of the database pool. Defaults
144- to engine defaults (usually 5)
145- ``SQLALCHEMY_POOL_TIMEOUT `` specifies the connection timeout for the
146- pool. Defaults to 10
147- ``SQLALCHEMY_POOL_RECYCLE `` number of sections after which a
141+ postgres on some Ubuntu versions)
142+ ``SQLALCHEMY_POOL_SIZE `` The size of the database pool. Defaults
143+ to the engine's default (usually 5)
144+ ``SQLALCHEMY_POOL_TIMEOUT `` Specifies the connection timeout for the
145+ pool. Defaults to 10.
146+ ``SQLALCHEMY_POOL_RECYCLE `` Number of seconds after which a
148147 connection is automatically recycled.
149- This is required for MySQL that removes
148+ This is required for MySQL, which removes
150149 connections after 8 hours idle by
151150 default. Note that Flask-SQLAlchemy
152151 automatically sets this to 2 hours if
@@ -161,8 +160,8 @@ The following configuration values exist for Flask-SQLAlchemy:
161160API
162161---
163162
164- This part of the documentation documents each and every public class or
165- function from Flask-SQLAlchemy.
163+ This part of the documentation documents all the public classes and
164+ functions in Flask-SQLAlchemy.
166165
167166Configuration
168167`````````````
@@ -179,11 +178,6 @@ Models
179178.. autoclass :: BaseQuery
180179 :members: get, get_or_404, paginate, first_or_404
181180
182- .. method :: get(ident)
183-
184- Return an instance of the object based on the given identifier
185- (primary key), or `None ` if not found.
186-
187181 .. method :: all()
188182
189183 Return the results represented by this query as a list. This
0 commit comments