From: Elrond Date: Tue, 20 Mar 2012 11:32:11 +0000 (+0100) Subject: Import "Base" from base instead of models. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=39fd817ab8c4745187e5e1992d2f2866de38e2c2;p=mediagoblin.git Import "Base" from base instead of models. Import the "Base" class for models from db.sql.base instead of db.sql.models. --- 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)