diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-05-19 01:35:02 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-05-19 01:35:02 +0200 |
commit | a67fec8177c09c4e74ce7f4301b88f4e7ea6e658 (patch) | |
tree | 72cfef277382314716e101988b6469dba324ae64 /mediagoblin/db/util.py | |
parent | 86f9b473877434e5a811d057e192c91a70d67ef5 (diff) | |
download | mediagoblin-a67fec8177c09c4e74ce7f4301b88f4e7ea6e658.tar.lz mediagoblin-a67fec8177c09c4e74ce7f4301b88f4e7ea6e658.tar.xz mediagoblin-a67fec8177c09c4e74ce7f4301b88f4e7ea6e658.zip |
Factor out most of the database connection into db/open.py
I needed to split the db connection/opening into open.py,
due to an import loop:
- util.py needs db/util.py:ObjectId
- db/util.py would need db/models.py
- db/models.py needs util.py:slugify
Diffstat (limited to 'mediagoblin/db/util.py')
-rw-r--r-- | mediagoblin/db/util.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py index 407caf05..30615fca 100644 --- a/mediagoblin/db/util.py +++ b/mediagoblin/db/util.py @@ -14,20 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import mongokit - -from paste.deploy.converters import asint # Imports that other modules might use from pymongo import DESCENDING from mongokit import ObjectId - - -def connect_database_from_config(app_config): - """Connect to the main database, take config from app_config""" - port = app_config.get('db_port') - if port: - port = asint(port) - connection = mongokit.Connection( - app_config.get('db_host'), port) - return connection |