Skip to content

Commit

Permalink
Fixed small mistake in sqlalchemy pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
spappier committed Sep 4, 2012
1 parent 80b2689 commit 69e419e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/patterns/sqlalchemy.rst
Expand Up @@ -42,7 +42,7 @@ Here the example `database.py` module for your application::
engine = create_engine('sqlite:////tmp/test.db', convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=False,
bind=engine))
bind=engine))
Base = declarative_base()
Base.query = db_session.query_property()

Expand Down Expand Up @@ -130,7 +130,7 @@ Here is an example `database.py` module for your application::
metadata = MetaData()
db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=False,
bind=engine))
bind=engine))
def init_db():
metadata.create_all(bind=engine)

Expand Down Expand Up @@ -189,7 +189,7 @@ To insert data you can use the `insert` method. We have to get a
connection first so that we can use a transaction:

>>> con = engine.connect()
>>> con.execute(users.insert(name='admin', email='admin@localhost'))
>>> con.execute(users.insert(), name='admin', email='admin@localhost')

SQLAlchemy will automatically commit for us.

Expand Down

0 comments on commit 69e419e

Please sign in to comment.