mirror of
https://github.com/django/django.git
synced 2025-07-05 02:09:13 +00:00
[soc2009/multidb] Clarified text of deprecation warnings. Patch from Russell Keith-Magee.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
808aa3b89d
commit
255608f085
@ -34,13 +34,14 @@ if not settings.DATABASES:
|
|||||||
if DEFAULT_DB_ALIAS not in settings.DATABASES:
|
if DEFAULT_DB_ALIAS not in settings.DATABASES:
|
||||||
raise ImproperlyConfigured("You must default a '%s' database" % DEFAULT_DB_ALIAS)
|
raise ImproperlyConfigured("You must default a '%s' database" % DEFAULT_DB_ALIAS)
|
||||||
|
|
||||||
for database in settings.DATABASES.values():
|
for alias, database in settings.DATABASES.items():
|
||||||
if database['ENGINE'] in ("postgresql", "postgresql_psycopg2", "sqlite3", "mysql", "oracle"):
|
if database['ENGINE'] in ("postgresql", "postgresql_psycopg2", "sqlite3", "mysql", "oracle"):
|
||||||
import warnings
|
import warnings
|
||||||
if 'django.contrib.gis' in settings.INSTALLED_APPS:
|
if 'django.contrib.gis' in settings.INSTALLED_APPS:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"django.contrib.gis is now implemented as a full database backend.\n"
|
"django.contrib.gis is now implemented as a full database backend. "
|
||||||
"Modify DATABASE_ENGINE to select a backend from 'django.contrib.gis.db.backends'",
|
"Modify ENGINE in the %s database configuration to select "
|
||||||
|
"a backend from 'django.contrib.gis.db.backends'" % alias,
|
||||||
PendingDeprecationWarning
|
PendingDeprecationWarning
|
||||||
)
|
)
|
||||||
if database['ENGINE'] == 'postgresql_psycopg2':
|
if database['ENGINE'] == 'postgresql_psycopg2':
|
||||||
@ -51,7 +52,8 @@ for database in settings.DATABASES.values():
|
|||||||
full_engine = 'django.contrib.gis.db.backends.%s' % database['ENGINE']
|
full_engine = 'django.contrib.gis.db.backends.%s' % database['ENGINE']
|
||||||
else:
|
else:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"Short names for DATABASE_ENGINE are deprecated; prepend with 'django.db.backends.'",
|
"Short names for ENGINE in database configurations are deprecated. "
|
||||||
|
"Prepend %s.ENGINE with 'django.db.backends.'" % alias,
|
||||||
PendingDeprecationWarning
|
PendingDeprecationWarning
|
||||||
)
|
)
|
||||||
full_engine = "django.db.backends.%s" % database['ENGINE']
|
full_engine = "django.db.backends.%s" % database['ENGINE']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user