From 39fd817ab8c4745187e5e1992d2f2866de38e2c2 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 20 Mar 2012 12:32:11 +0100 Subject: [PATCH] Import "Base" from base instead of models. Import the "Base" class for models from db.sql.base instead of db.sql.models. --- mediagoblin/db/sql/convert.py | 4 ++-- mediagoblin/db/sql/open.py | 3 +-- mediagoblin/media_types/ascii/models.py | 2 +- mediagoblin/media_types/image/models.py | 2 +- mediagoblin/media_types/video/models.py | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index d1492977..232e424f 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -19,7 +19,8 @@ from copy import copy from mediagoblin.init import setup_global_and_app_config, setup_database from mediagoblin.db.mongo.util import ObjectId -from mediagoblin.db.sql.models import (Base, User, MediaEntry, MediaComment, +from mediagoblin.db.sql.base import Base, Session +from mediagoblin.db.sql.models import (User, MediaEntry, MediaComment, Tag, MediaTag, MediaFile, MediaAttachmentFile, MigrationData) from mediagoblin.media_types.image.models import ImageData from mediagoblin.media_types.video.models import VideoData @@ -27,7 +28,6 @@ from mediagoblin.db.sql.open import setup_connection_and_db_from_config as \ sql_connect from mediagoblin.db.mongo.open import setup_connection_and_db_from_config as \ mongo_connect -from mediagoblin.db.sql.base import Session obj_id_table = dict() diff --git a/mediagoblin/db/sql/open.py b/mediagoblin/db/sql/open.py index 9819b468..7362b1c5 100644 --- a/mediagoblin/db/sql/open.py +++ b/mediagoblin/db/sql/open.py @@ -18,8 +18,7 @@ from sqlalchemy import create_engine import logging -from mediagoblin.db.sql.base import Session -from mediagoblin.db.sql.models import Base +from mediagoblin.db.sql.base import Base, Session class DatabaseMaster(object): diff --git a/mediagoblin/media_types/ascii/models.py b/mediagoblin/media_types/ascii/models.py index 03907339..043a858a 100644 --- a/mediagoblin/media_types/ascii/models.py +++ b/mediagoblin/media_types/ascii/models.py @@ -15,7 +15,7 @@ # along with this program. If not, see . -from mediagoblin.db.sql.models import Base +from mediagoblin.db.sql.base import Base from sqlalchemy import ( Column, Integer, Unicode, UnicodeText, DateTime, Boolean, ForeignKey, diff --git a/mediagoblin/media_types/image/models.py b/mediagoblin/media_types/image/models.py index f333cbb8..5b9edb50 100644 --- a/mediagoblin/media_types/image/models.py +++ b/mediagoblin/media_types/image/models.py @@ -1,4 +1,4 @@ -from mediagoblin.db.sql.models import Base +from mediagoblin.db.sql.base import Base from sqlalchemy import ( Column, Integer, Float, ForeignKey) diff --git a/mediagoblin/media_types/video/models.py b/mediagoblin/media_types/video/models.py index 0d064f5f..cf42b7c8 100644 --- a/mediagoblin/media_types/video/models.py +++ b/mediagoblin/media_types/video/models.py @@ -15,7 +15,7 @@ # along with this program. If not, see . -from mediagoblin.db.sql.models import Base +from mediagoblin.db.sql.base import Base from sqlalchemy import ( Column, Integer, SmallInteger, ForeignKey) -- 2.25.1