mirror of
https://github.com/django/django.git
synced 2025-09-06 18:50:55 +00:00
Fixed #27170 -- Added DatabaseWrapper class attributes to ease subclassing.
This commit is contained in:
parent
0bbab97c28
commit
7ca3b391b6
11 changed files with 87 additions and 70 deletions
|
@ -10,7 +10,6 @@ from django.conf import settings
|
|||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db import DEFAULT_DB_ALIAS
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.base.validation import BaseDatabaseValidation
|
||||
from django.db.utils import DatabaseError as WrappedDatabaseError
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_str
|
||||
|
@ -141,16 +140,12 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||
|
||||
Database = Database
|
||||
SchemaEditorClass = DatabaseSchemaEditor
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(DatabaseWrapper, self).__init__(*args, **kwargs)
|
||||
|
||||
self.features = DatabaseFeatures(self)
|
||||
self.ops = DatabaseOperations(self)
|
||||
self.client = DatabaseClient(self)
|
||||
self.creation = DatabaseCreation(self)
|
||||
self.introspection = DatabaseIntrospection(self)
|
||||
self.validation = BaseDatabaseValidation(self)
|
||||
# Classes instantiated in __init__().
|
||||
client_class = DatabaseClient
|
||||
creation_class = DatabaseCreation
|
||||
features_class = DatabaseFeatures
|
||||
introspection_class = DatabaseIntrospection
|
||||
ops_class = DatabaseOperations
|
||||
|
||||
def get_connection_params(self):
|
||||
settings_dict = self.settings_dict
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue