Mv db.sql.base to db.base
This concludes the db.sql.* -> db.* move. Our db abstraction layer is sqlalchemy, so there is no need to a separate db.sql.* hierarchy. All tests have been run for each of the commit series to make sure everything works at every step.
This commit is contained in:
parent
a5acfe23fa
commit
39dc3bf8db
@ -32,9 +32,8 @@ from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.util import memoized_property
|
||||
|
||||
from mediagoblin.db.extratypes import PathTupleWithSlashes, JSONEncoded
|
||||
from mediagoblin.db.sql.base import Base, DictReadAttrProxy
|
||||
from mediagoblin.db.base import Base, DictReadAttrProxy, Session
|
||||
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin, MediaCommentMixin, CollectionMixin, CollectionItemMixin
|
||||
from mediagoblin.db.sql.base import Session
|
||||
|
||||
# It's actually kind of annoying how sqlalchemy-migrate does this, if
|
||||
# I understand it right, but whatever. Anyway, don't remove this :P
|
||||
|
@ -32,8 +32,7 @@ from sqlalchemy.ext.associationproxy import association_proxy
|
||||
from sqlalchemy.util import memoized_property
|
||||
|
||||
from mediagoblin.db.extratypes import PathTupleWithSlashes, JSONEncoded
|
||||
from mediagoblin.db.sql.base import GMGTableBase
|
||||
from mediagoblin.db.sql.base import Session
|
||||
from mediagoblin.db.base import GMGTableBase, Session
|
||||
|
||||
|
||||
Base_v0 = declarative_base(cls=GMGTableBase)
|
||||
|
@ -18,7 +18,7 @@
|
||||
from sqlalchemy import create_engine
|
||||
import logging
|
||||
|
||||
from mediagoblin.db.sql.base import Base, Session
|
||||
from mediagoblin.db.base import Base, Session
|
||||
from mediagoblin import mg_globals
|
||||
|
||||
_log = logging.getLogger(__name__)
|
||||
|
@ -1,15 +0,0 @@
|
||||
# GNU MediaGoblin -- federated, autonomous media hosting
|
||||
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# 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/>.
|
@ -14,7 +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 sys
|
||||
from mediagoblin.db.sql.base import Session
|
||||
from mediagoblin.db.base import Session
|
||||
from mediagoblin.db.models import MediaEntry, Tag, MediaTag, Collection
|
||||
|
||||
from mediagoblin.tools.common import simple_printer
|
||||
|
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from mediagoblin.db.sql.base import Base
|
||||
from mediagoblin.db.base import Base
|
||||
|
||||
from sqlalchemy import (
|
||||
Column, Integer, ForeignKey)
|
||||
|
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from mediagoblin.db.sql.base import Base
|
||||
from mediagoblin.db.base import Base
|
||||
|
||||
from sqlalchemy import (
|
||||
Column, Integer, ForeignKey)
|
||||
|
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from mediagoblin.db.sql.base import Base
|
||||
from mediagoblin.db.base import Base
|
||||
|
||||
from sqlalchemy import (
|
||||
Column, Integer, Float, ForeignKey)
|
||||
|
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from mediagoblin.db.sql.base import Base
|
||||
from mediagoblin.db.base import Base
|
||||
|
||||
from sqlalchemy import (
|
||||
Column, Integer, SmallInteger, ForeignKey)
|
||||
|
@ -19,7 +19,7 @@ import bcrypt
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from mediagoblin.db.sql.base import Base
|
||||
from mediagoblin.db.base import Base
|
||||
from mediagoblin.db.models import User
|
||||
|
||||
from sqlalchemy import (
|
||||
|
@ -25,7 +25,7 @@ from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.sql import select, insert
|
||||
from migrate import changeset
|
||||
|
||||
from mediagoblin.db.sql.base import GMGTableBase
|
||||
from mediagoblin.db.base import GMGTableBase
|
||||
from mediagoblin.db.util import MigrationManager, RegisterMigration
|
||||
from mediagoblin.tools.common import CollectingPrinter
|
||||
|
||||
|
@ -28,7 +28,7 @@ from mediagoblin import mg_globals
|
||||
from mediagoblin.tools import testing
|
||||
from mediagoblin.init.config import read_mediagoblin_config
|
||||
from mediagoblin.db.open import setup_connection_and_db_from_config
|
||||
from mediagoblin.db.sql.base import Session
|
||||
from mediagoblin.db.base import Session
|
||||
from mediagoblin.meddleware import BaseMeddleware
|
||||
from mediagoblin.auth.lib import bcrypt_gen_password_hash
|
||||
from mediagoblin.gmg_commands.dbupdate import run_dbupdate
|
||||
@ -219,7 +219,6 @@ def fixture_add_user(username=u'chris', password='toast',
|
||||
test_user = mg_globals.database.User.find_one({'username': username})
|
||||
|
||||
# ... and detach from session:
|
||||
from mediagoblin.db.sql.base import Session
|
||||
Session.expunge(test_user)
|
||||
|
||||
return test_user
|
||||
|
Loading…
x
Reference in New Issue
Block a user