Author: russellm
Date: 2008-08-22 09:18:53 -0500 (Fri, 22 Aug 2008)
New Revision: 8466
Modified:
django/trunk/django/db/backends/mysql/base.py
django/trunk/django/db/backends/oracle/base.py
Log:
Fixed #8485: Reordered imports in the database backends to ensure that the
availability of the MySQL and Oracle backends is confirmed before any attempt
is made to use the backend. Many thanks to Karen Tracey for her work in
narrowing down a number of vague reports into a concrete problem.
Modified: django/trunk/django/db/backends/mysql/base.py
===================================================================
--- django/trunk/django/db/backends/mysql/base.py 2008-08-22 14:07:50 UTC
(rev 8465)
+++ django/trunk/django/db/backends/mysql/base.py 2008-08-22 14:18:53 UTC
(rev 8466)
@@ -6,12 +6,6 @@
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 @@
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:
Modified: django/trunk/django/db/backends/oracle/base.py
===================================================================
--- django/trunk/django/db/backends/oracle/base.py 2008-08-22 14:07:50 UTC
(rev 8465)
+++ django/trunk/django/db/backends/oracle/base.py 2008-08-22 14:18:53 UTC
(rev 8466)
@@ -8,13 +8,6 @@
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 @@
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---