Fixed #5255 -- It's now possible again to use Django without a database. This had temporarily gotten buggy after the django.core.management refactoring last week
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
de64e0d570
commit
6d387d3d1b
|
@ -8,6 +8,7 @@ ImproperlyConfigured.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations
|
||||||
|
|
||||||
def complain(*args, **kwargs):
|
def complain(*args, **kwargs):
|
||||||
raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."
|
raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."
|
||||||
|
@ -21,13 +22,12 @@ class DatabaseError(Exception):
|
||||||
class IntegrityError(DatabaseError):
|
class IntegrityError(DatabaseError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class ComplainOnGetattr(object):
|
class DatabaseOperations(BaseDatabaseOperations):
|
||||||
def __getattr__(self, *args, **kwargs):
|
quote_name = complain
|
||||||
complain()
|
|
||||||
|
|
||||||
class DatabaseWrapper(object):
|
class DatabaseWrapper(object):
|
||||||
features = ComplainOnGetattr()
|
features = BaseDatabaseFeatures()
|
||||||
ops = ComplainOnGetattr()
|
ops = DatabaseOperations()
|
||||||
operators = {}
|
operators = {}
|
||||||
cursor = complain
|
cursor = complain
|
||||||
_commit = complain
|
_commit = complain
|
||||||
|
|
Loading…
Reference in New Issue