diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 9b82a1c8f0..07fb700eaa 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -6,12 +6,6 @@ Requires MySQLdb: http://sourceforge.net/projects/mysql-python import re -from django.db.backends import * -from django.db.backends.mysql.client import DatabaseClient -from django.db.backends.mysql.creation import DatabaseCreation -from django.db.backends.mysql.introspection import DatabaseIntrospection -from django.db.backends.mysql.validation import DatabaseValidation - try: import MySQLdb as Database except ImportError, e: @@ -30,6 +24,12 @@ if (version < (1,2,1) or (version[:3] == (1, 2, 1) and from MySQLdb.converters import conversions from MySQLdb.constants import FIELD_TYPE, FLAG +from django.db.backends import * +from django.db.backends.mysql.client import DatabaseClient +from django.db.backends.mysql.creation import DatabaseCreation +from django.db.backends.mysql.introspection import DatabaseIntrospection +from django.db.backends.mysql.validation import DatabaseValidation + # Raise exceptions for database warnings if DEBUG is on from django.conf import settings if settings.DEBUG: diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 33900e755c..83543969ea 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -8,13 +8,6 @@ import os import datetime import time -from django.db.backends import * -from django.db.backends.oracle import query -from django.db.backends.oracle.client import DatabaseClient -from django.db.backends.oracle.creation import DatabaseCreation -from django.db.backends.oracle.introspection import DatabaseIntrospection -from django.utils.encoding import smart_str, force_unicode - # Oracle takes client-side character set encoding from the environment. os.environ['NLS_LANG'] = '.UTF8' try: @@ -23,6 +16,13 @@ except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e) +from django.db.backends import * +from django.db.backends.oracle import query +from django.db.backends.oracle.client import DatabaseClient +from django.db.backends.oracle.creation import DatabaseCreation +from django.db.backends.oracle.introspection import DatabaseIntrospection +from django.utils.encoding import smart_str, force_unicode + DatabaseError = Database.Error IntegrityError = Database.IntegrityError