summaryrefslogtreecommitdiff
path: root/django/db/backends/__init__.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-09-25 19:59:03 +0200
committerClaude Paroz <claude@2xlibre.net>2014-09-26 08:50:16 +0200
commitd1ca70110f49f0be90206c8da516ac16aebc8c75 (patch)
tree9aa9853a39d4e81ad4ae651df02d1d924bcd6f7a /django/db/backends/__init__.py
parenta8f07530a74839d20f1f2fb2cc7f5b8ef2215782 (diff)
Factorized schema_editor() at BaseDatabaseWrapper level
Diffstat (limited to 'django/db/backends/__init__.py')
-rw-r--r--django/db/backends/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 1f0e7b255c..9873d9cba6 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -37,6 +37,7 @@ class BaseDatabaseWrapper(object):
"""
ops = None
vendor = 'unknown'
+ SchemaEditorClass = None
queries_limit = 9000
@@ -479,8 +480,13 @@ class BaseDatabaseWrapper(object):
)
def schema_editor(self, *args, **kwargs):
- "Returns a new instance of this backend's SchemaEditor"
- raise NotImplementedError('subclasses of BaseDatabaseWrapper may require a schema_editor() method')
+ """
+ Returns a new instance of this backend's SchemaEditor.
+ """
+ if self.SchemaEditorClass is None:
+ raise NotImplementedError(
+ 'The SchemaEditorClass attribute of this database wrapper is still None')
+ return self.SchemaEditorClass(self, *args, **kwargs)
class BaseDatabaseFeatures(object):