diff options
author | Georg Brandl <georg@python.org> | 2010-08-21 22:33:09 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-08-21 22:33:09 +0200 |
commit | 092ebec8a7eb938a2c720d57b258bd6e106bff9e (patch) | |
tree | ee6812efd7de0d796cb0fcf37cceb5aeab72b611 /sphinx/websupport/storage/sqlalchemystorage.py | |
parent | 7dd3f40461b87e599d5fdc19fe7153edb428cc3e (diff) | |
download | sphinx-git-092ebec8a7eb938a2c720d57b258bd6e106bff9e.tar.gz |
Move default sqlalchemy engine creation to storage backend.
Diffstat (limited to 'sphinx/websupport/storage/sqlalchemystorage.py')
-rw-r--r-- | sphinx/websupport/storage/sqlalchemystorage.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/websupport/storage/sqlalchemystorage.py b/sphinx/websupport/storage/sqlalchemystorage.py index baef24816..dea2eea02 100644 --- a/sphinx/websupport/storage/sqlalchemystorage.py +++ b/sphinx/websupport/storage/sqlalchemystorage.py @@ -32,11 +32,11 @@ class SQLAlchemyStorage(StorageBackend): A :class:`.StorageBackend` using SQLAlchemy. """ - def __init__(self, engine): - self.engine = engine - Base.metadata.bind = engine + def __init__(self, uri): + self.engine = sqlalchemy.create_engine(uri) + Base.metadata.bind = self.engine Base.metadata.create_all() - Session.configure(bind=engine) + Session.configure(bind=self.engine) def pre_build(self): self.build_session = Session() |