Skip to content
Myr

added coming soon to parts of the docs, linked scoped_session

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 7c9303b · Browse files · 2 files+16 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−2 removed

  • other:+16 added−2 removed

2 files+16 added−2 removed

modified:docs/conf.py+2 added-1 removed
239 unmodified lines
240#epub_tocdepth = 3241242intersphinx_mapping = {243 'http://docs.python.org/dev': None,244 'http://werkzeug.pocoo.org/documentation/dev/': None244 'http://werkzeug.pocoo.org/documentation/dev/': None,245 'http://www.sqlalchemy.org/docs/': None246}
modified:docs/patterns.rst+14 added-1 removed
224 unmodified lines
225 def init_db():226 Base.metadata.create_all(bind=engine)227228To define your models, just subclass the `Base` class that was created by229the code above.229the code above. If you are wondering why we don't have to care about230threads here (like we did in the SQLite3 example above with the231:data:`~flask.g` object): that's because SQLAlchemy does that for us232already with the :class:`~sqlalchemy.orm.scoped_session`.233234To use SQLAlchemy in a declarative way with your application, you just235have to put the following code into your application module. Flask will236automatically remove database sessions at the end of the request for you::
41 unmodified lines
278.. _SQLAlchemy: http://www.sqlalchemy.org/279.. _declarative:280 http://www.sqlalchemy.org/docs/reference/ext/declarative.html281282Manual Object Relational Mapping283--------------------------------284285*coming soon*286287SQL Abstraction Layer288---------------------289290*coming soon*291292293.. _template-inheritance:294295Template Inheritance296--------------------
147 unmodified lines