From 6418551efb1d24320c261b1e24c186d5394e6dcf Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 16 Apr 2010 13:29:01 +0200 Subject: [PATCH] More typo fixes --- docs/becomingbig.rst | 2 +- docs/patterns.rst | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/becomingbig.rst b/docs/becomingbig.rst index c964fe27..82d8c4a0 100644 --- a/docs/becomingbig.rst +++ b/docs/becomingbig.rst @@ -33,7 +33,7 @@ scale applications: also requires that the whole application is imported when the system initializes or certain URLs will not be available right away. A better solution would be to have one module with all URLs in there and - specifing the target functions explictliy or by name and importing + specifing the target functions explictly or by name and importing them when needed. - switch to explicit request object passing. This makes it more to type (because you now have something to pass around) but it makes it a diff --git a/docs/patterns.rst b/docs/patterns.rst index 5956ab83..7c2c85c6 100644 --- a/docs/patterns.rst +++ b/docs/patterns.rst @@ -195,7 +195,7 @@ SQLAlchemy in Flask Many people prefer `SQLAlchemy`_ for database access. In this case it's encouraged to use a package instead of a module for your flask application -and drop the modules into a separate module (:ref:`larger-applications`). +and drop the models into a separate module (:ref:`larger-applications`). Although that is not necessary but makes a lot of sense. There are three very common ways to use SQLAlchemy. I will outline each @@ -225,10 +225,11 @@ Here the example `database.py` module for your application:: def init_db(): Base.metadata.create_all(bind=engine) -To define your models, subclass the `Base` class the above code generated. +To define your models, just subclass the `Base` class that was created by +the code above. To use SQLAlchemy in a declarative way with your application, you just -have to put the following code into your application module Flask will +have to put the following code into your application module. Flask will automatically remove database sessions at the end of the request for you:: from yourapplication.database import db_session